mirror of
https://github.com/tinygo-org/tinygo.git
synced 2026-08-03 02:27:48 +00:00
windows: fix wrong register for first parameter
I'm surprised this worked as long as it did, since it looks like the goroutine stack did not get scanned. Or maybe the RCX register contained the stack pointer by accident. In any case, it now uses the correct register (RCX instead of RDI on Windows) for passing the stack pointer as the first parameter.
This commit is contained in:
committed by
Ron Evans
parent
48f145c4df
commit
fd3976b5bb
@@ -12,8 +12,8 @@ tinygo_scanCurrentStack:
|
||||
pushq %r15
|
||||
|
||||
// Scan the stack.
|
||||
subq $8, %rsp // adjust the stack before the call to maintain 16-byte alignment
|
||||
movq %rsp, %rdi
|
||||
subq $8, %rsp // adjust the stack before the call to maintain 16-byte alignment
|
||||
movq %rsp, %rcx // pass the stack pointer as the first parameter
|
||||
callq tinygo_scanstack
|
||||
|
||||
// Restore the stack pointer. Registers do not need to be restored as they
|
||||
|
||||
Reference in New Issue
Block a user