summaryrefslogtreecommitdiff
path: root/gc.c
diff options
context:
space:
mode:
authorUrabe, Shyouhei <shyouhei@ruby-lang.org>2019-04-23 18:02:24 +0900
committerUrabe, Shyouhei <shyouhei@ruby-lang.org>2019-04-26 15:59:40 +0900
commit3ba485c0bfcfc0be351ef8278cd27187f4c11906 (patch)
treeff2f2e6d7ab232123230bd33bdb1aca470c72ac3 /gc.c
parent504ce460d240b5b726e77c0b0915677892a19e58 (diff)
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.
Diffstat (limited to 'gc.c')
-rw-r--r--gc.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/gc.c b/gc.c
index b4ad456b41..f1715de7b7 100644
--- a/gc.c
+++ b/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);