mirror of
https://github.com/tinygo-org/tinygo.git
synced 2026-08-08 04:53:42 +00:00
runtime: load sp and pc inside tinygo_longjmp
This is a small change to make it easier to support architectures that need to restore more than just the sp and pc registers. In particular, it is needed for the AVR architecture that needs to restore the frame pointer (Y register).
This commit is contained in:
committed by
Ron Evans
parent
c119721e3b
commit
49e22fe678
@@ -13,7 +13,7 @@ func trap()
|
||||
// Inline assembly stub. It is essentially C longjmp but modified a bit for the
|
||||
// purposes of TinyGo. It restores the stack pointer and jumps to the given pc.
|
||||
//export tinygo_longjmp
|
||||
func tinygo_longjmp(sp, pc unsafe.Pointer)
|
||||
func tinygo_longjmp(frame *task.DeferFrame)
|
||||
|
||||
// Compiler intrinsic.
|
||||
// Returns whether recover is supported on the current architecture.
|
||||
@@ -26,7 +26,7 @@ func _panic(message interface{}) {
|
||||
if frame != nil {
|
||||
frame.PanicValue = message
|
||||
frame.Panicking = true
|
||||
tinygo_longjmp(frame.JumpSP, frame.JumpPC)
|
||||
tinygo_longjmp(frame)
|
||||
// unreachable
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user