Skip to content

Commit f05b378

Browse files
aykevldeadprogram
authored andcommitted
compiler: add proper parameter names to runtime.initAll
This is required by the coroutines pass, otherwise it will panic. It checks for the proper parameter names to make sure the function is not exported. In this case, the runtime.initAll function wasn't exported but simply didn't have the correct parameter names so the check triggered even though it shouldn't.
1 parent 888ca4a commit f05b378

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

compiler/compiler.go

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -293,6 +293,8 @@ func Compile(pkgName string, machine llvm.TargetMachine, config *compileopts.Con
293293
pos := c.ir.Program.Fset.Position(initFn.Pos())
294294
irbuilder.SetCurrentDebugLocation(uint(pos.Line), uint(pos.Column), difunc, llvm.Metadata{})
295295
}
296+
initFn.LLVMFn.Param(0).SetName("context")
297+
initFn.LLVMFn.Param(1).SetName("parentHandle")
296298
block := c.ctx.AddBasicBlock(initFn.LLVMFn, "entry")
297299
irbuilder.SetInsertPointAtEnd(block)
298300
for _, fn := range initFuncs {

0 commit comments

Comments
 (0)