mirror of
https://github.com/tinygo-org/tinygo.git
synced 2026-08-06 12:03:41 +00:00
compiler: allow deferred panic
This is rare, but apparently some programs do this:
defer panic("...")
This is emitted in the IR as a builtin function.
This commit is contained in:
@@ -1680,6 +1680,10 @@ func (b *builder) createBuiltin(argTypes []types.Type, argValues []llvm.Value, c
|
||||
result = b.CreateSelect(cmp, result, arg, "")
|
||||
}
|
||||
return result, nil
|
||||
case "panic":
|
||||
// This is rare, but happens in "defer panic()".
|
||||
b.createRuntimeInvoke("_panic", argValues, "")
|
||||
return llvm.Value{}, nil
|
||||
case "print", "println":
|
||||
for i, value := range argValues {
|
||||
if i >= 1 && callName == "println" {
|
||||
|
||||
Reference in New Issue
Block a user