aboutsummaryrefslogtreecommitdiffhomepage
path: root/interp/interpreter.go
diff options
context:
space:
mode:
authorAyke van Laethem <[email protected]>2021-04-05 14:46:08 +0200
committerRon Evans <[email protected]>2021-04-08 11:40:59 +0200
commit61243f6c57b4158c28666ebadc6344e143ca02f1 (patch)
tree1be50b83b9cbcbe7b7928eefe739bc116c628a14 /interp/interpreter.go
parent49ec3eb58e3ae2fd373b1c65883dcd05c588357a (diff)
downloadtinygo-61243f6c57b4158c28666ebadc6344e143ca02f1.tar.gz
tinygo-61243f6c57b4158c28666ebadc6344e143ca02f1.zip
transform: don't rely on struct name of runtime.typecodeID
Sometimes, LLVM may rename named structs when merging modules. Therefore, we can't rely on typecodeID structs to retain their struct names. This commit changes the interface lowering pass to not rely on these names. The interp package does however still rely on this name, but I hope to fix that in the future.
Diffstat (limited to 'interp/interpreter.go')
-rw-r--r--interp/interpreter.go2
1 files changed, 1 insertions, 1 deletions
diff --git a/interp/interpreter.go b/interp/interpreter.go
index 3bbf9e5f9..c0dc45d93 100644
--- a/interp/interpreter.go
+++ b/interp/interpreter.go
@@ -328,7 +328,7 @@ func (r *runner) run(fn *function, params []value, parentMem *memoryView, indent
return nil, mem, r.errorAt(inst, err)
}
actualType := actualTypePtrToInt.Operand(0)
- if actualType.Name()+"$id" == assertedType.Name() {
+ if strings.TrimPrefix(actualType.Name(), "reflect/types.type:") == strings.TrimPrefix(assertedType.Name(), "reflect/types.typeid:") {
locals[inst.localIndex] = literalValue{uint8(1)}
} else {
locals[inst.localIndex] = literalValue{uint8(0)}