transform: fix OptimizeReflectImplements pass for new named elem offset

This commit is contained in:
Damian Gryski
2023-03-14 17:18:09 -07:00
committed by Ron Evans
parent 229f479a7d
commit e0329b25de
3 changed files with 7 additions and 7 deletions
+1 -1
View File
@@ -142,7 +142,7 @@ func OptimizeReflectImplements(mod llvm.Module) {
if strings.HasPrefix(interfaceType.Name(), "reflect/types.type:named:") {
// Get the underlying type.
interfaceType = stripPointerCasts(builder.CreateExtractValue(interfaceType.Initializer(), 2, ""))
interfaceType = stripPointerCasts(builder.CreateExtractValue(interfaceType.Initializer(), 3, ""))
}
if !strings.HasPrefix(interfaceType.Name(), "reflect/types.type:interface:") {
// This is an error. The Type passed to Implements should be of