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:
Ayke van Laethem
2025-03-22 09:30:49 +01:00
committed by Ron Evans
parent 48f145c4df
commit fd3976b5bb
+2 -2
View File
@@ -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