mirror of
https://github.com/tinygo-org/tinygo.git
synced 2026-08-08 04:53:42 +00:00
compiler,transform: fix for pointer-to-pointer type switches from @aykevl
This commit is contained in:
@@ -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.
|
||||
|
||||
Reference in New Issue
Block a user