mirror of
https://github.com/tinygo-org/tinygo.git
synced 2026-08-07 12:33:42 +00:00
compiler: support panics inside indirect deferred functions
Found this bug while working on WebAssembly recover support.
This commit is contained in:
+2
-2
@@ -528,7 +528,7 @@ func (b *builder) createRunDefers() {
|
||||
forwardParams = append(forwardParams, llvm.Undef(b.dataPtrType))
|
||||
}
|
||||
|
||||
b.createCall(fnType, fnPtr, forwardParams, "")
|
||||
b.createInvoke(fnType, fnPtr, forwardParams, "")
|
||||
|
||||
case *ssa.Function:
|
||||
// Direct call.
|
||||
@@ -583,7 +583,7 @@ func (b *builder) createRunDefers() {
|
||||
|
||||
// Call deferred function.
|
||||
fnType, llvmFn := b.getFunction(fn)
|
||||
b.createCall(fnType, llvmFn, forwardParams, "")
|
||||
b.createInvoke(fnType, llvmFn, forwardParams, "")
|
||||
case *ssa.Builtin:
|
||||
db := b.deferBuiltinFuncs[callback]
|
||||
|
||||
|
||||
Reference in New Issue
Block a user