mirror of
https://github.com/ruby/ruby.git
synced 2022-11-09 12:17:21 -05:00
zero-fill before GC mark
Depending on architectures, setjmp might not fully fill a jmp_buf. On such machines the union can contain wobbly bits. They are then scanned during mark_locations_array(). This is bad.
This commit is contained in:
parent
504ce460d2
commit
3ba485c0bf
1 changed files with 1 additions and 0 deletions
1
gc.c
1
gc.c
|
@ -4598,6 +4598,7 @@ mark_current_machine_context(rb_objspace_t *objspace, rb_execution_context_t *ec
|
|||
VALUE *stack_start, *stack_end;
|
||||
|
||||
FLUSH_REGISTER_WINDOWS;
|
||||
memset(&save_regs_gc_mark, 0, sizeof(save_regs_gc_mark));
|
||||
/* This assumes that all registers are saved into the jmp_buf (and stack) */
|
||||
rb_setjmp(save_regs_gc_mark.j);
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue