Skip to content

Commit f99c600

Browse files
aykevldeadprogram
authored andcommitted
transform: work around renamed return type after merging LLVM modules
This fix is very similar to #1768, but now for the return type. It fixes the issue in #1887. Like #1768, I'm not sure how to test this as it is very specific to certain renames that LLVM does and that don't seem very reproducable.
1 parent 15d3f5f commit f99c600

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

transform/interface-lowering.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -532,7 +532,7 @@ func (p *lowerInterfacesPass) getInterfaceMethodFunc(itf *interfaceInfo, signatu
532532
paramTypes = append(paramTypes, param.Type())
533533
}
534534
calledFunctionType := function.Type()
535-
sig := llvm.PointerType(llvm.FunctionType(calledFunctionType.ElementType().ReturnType(), paramTypes, false), calledFunctionType.PointerAddressSpace())
535+
sig := llvm.PointerType(llvm.FunctionType(returnType, paramTypes, false), calledFunctionType.PointerAddressSpace())
536536
if sig != function.Type() {
537537
function = p.builder.CreateBitCast(function, sig, "")
538538
}

0 commit comments

Comments
 (0)