diff options
author | Yuta Saito <[email protected]> | 2022-11-05 16:10:35 +0000 |
---|---|---|
committer | Yuta Saito <[email protected]> | 2022-11-06 05:03:21 +0900 |
commit | 3a6cdeda89280ade714f158830acee88fb36306d (patch) | |
tree | 91a912f319883c125f60b2c9d25f0c76c52dc2d7 /wasm/machine.h | |
parent | 267452e6fed5d31dcad3c20970f74eec009dc03f (diff) |
[wasm] Scan machine stack based on `ec->machine.stack_{start,end}`
fiber machine stack is placed outside of C stack allocated by wasm-ld,
so highest stack address recorded by `rb_wasm_record_stack_base` is
invalid when running on non-main fiber.
Therefore, we should scan `stack_{start,end}` which always point a valid
stack range in any context.
Notes
Notes:
Merged: https://github.com/ruby/ruby/pull/6679
Diffstat (limited to 'wasm/machine.h')
-rw-r--r-- | wasm/machine.h | 5 |
1 files changed, 2 insertions, 3 deletions
diff --git a/wasm/machine.h b/wasm/machine.h index 4cf7228684..1a60e51d11 100644 --- a/wasm/machine.h +++ b/wasm/machine.h @@ -8,9 +8,8 @@ typedef void (*rb_wasm_scan_func)(void*, void*); // Used by conservative GC void rb_wasm_scan_locals(rb_wasm_scan_func scan); -// Scan userland C-stack memory space in WebAssembly. Used by conservative GC -#define rb_wasm_scan_stack(scan) _rb_wasm_scan_stack((scan), rb_wasm_get_stack_pointer()) -void _rb_wasm_scan_stack(rb_wasm_scan_func scan, void *current); +// Get base address of userland C-stack memory space in WebAssembly. Used by conservative GC +void *rb_wasm_stack_get_base(void); // Get the current stack pointer |