mirror of
https://github.com/tinygo-org/tinygo.git
synced 2026-08-04 02:57:46 +00:00
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.
This commit is contained in:
committed by
Ron Evans
parent
888ca4ab0c
commit
f05b378b89
@@ -293,6 +293,8 @@ func Compile(pkgName string, machine llvm.TargetMachine, config *compileopts.Con
|
||||
pos := c.ir.Program.Fset.Position(initFn.Pos())
|
||||
irbuilder.SetCurrentDebugLocation(uint(pos.Line), uint(pos.Column), difunc, llvm.Metadata{})
|
||||
}
|
||||
initFn.LLVMFn.Param(0).SetName("context")
|
||||
initFn.LLVMFn.Param(1).SetName("parentHandle")
|
||||
block := c.ctx.AddBasicBlock(initFn.LLVMFn, "entry")
|
||||
irbuilder.SetInsertPointAtEnd(block)
|
||||
for _, fn := range initFuncs {
|
||||
|
||||
Reference in New Issue
Block a user