mirror of
https://github.com/tinygo-org/tinygo.git
synced 2026-08-10 22:13:39 +00:00
wasm: execute an 'unreachable' trap inst on panic
This already happened when directly calling panic() but not with some runtime panics like accessing a slice out of bounds.
This commit is contained in:
@@ -1,5 +1,10 @@
|
||||
package runtime
|
||||
|
||||
// trap is a compiler hint that this function cannot be executed. It is
|
||||
// translated into either a trap instruction or a call to abort().
|
||||
//go:linkname trap llvm.trap
|
||||
func trap()
|
||||
|
||||
// Builtin function panic(msg), used as a compiler intrinsic.
|
||||
func _panic(message interface{}) {
|
||||
printstring("panic: ")
|
||||
|
||||
Reference in New Issue
Block a user