diff options
author | Damian Gryski <[email protected]> | 2023-06-01 10:41:36 -0700 |
---|---|---|
committer | Ron Evans <[email protected]> | 2023-06-09 17:30:02 +0200 |
commit | f5f4751088bd40a8680899eefeb9854c8dbf4b33 (patch) | |
tree | b7a20ff88c6f31d368fcc783a6a92fa81021ab33 /compiler | |
parent | 62fb386d57a0080881c756000e42a2c873372eb8 (diff) | |
download | tinygo-f5f4751088bd40a8680899eefeb9854c8dbf4b33.tar.gz tinygo-f5f4751088bd40a8680899eefeb9854c8dbf4b33.zip |
compiler,transform: fix for pointer-to-pointer type switches from @aykevl
Diffstat (limited to 'compiler')
-rw-r--r-- | compiler/interface.go | 7 |
1 files changed, 2 insertions, 5 deletions
diff --git a/compiler/interface.go b/compiler/interface.go index 7b49a81d4..3fdb30bb8 100644 --- a/compiler/interface.go +++ b/compiler/interface.go @@ -683,11 +683,8 @@ func (b *builder) createTypeAssert(expr *ssa.TypeAssert) llvm.Value { commaOk = b.CreateCall(fn.GlobalValueType(), fn, []llvm.Value{actualTypeNum}, "") } else { - assertedTypeGlobal := b.getTypeCode(expr.AssertedType) - if !assertedTypeGlobal.IsAConstantExpr().IsNil() { - assertedTypeGlobal = assertedTypeGlobal.Operand(0) // resolve the GEP operation - } - globalName := "reflect/types.typeid:" + strings.TrimPrefix(assertedTypeGlobal.Name(), "reflect/types.type:") + name, _ := getTypeCodeName(expr.AssertedType) + globalName := "reflect/types.typeid:" + name assertedTypeCodeGlobal := b.mod.NamedGlobal(globalName) if assertedTypeCodeGlobal.IsNil() { // Create a new typecode global. |