Skip to content

Commit

Permalink
zero-fill before GC mark
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
shyouhei committed Apr 26, 2019
1 parent 504ce46 commit 3ba485c
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions gc.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);

Expand Down

0 comments on commit 3ba485c

Please sign in to comment.