From 932a471d3811d6d44764ce42b1b140a04961a763 Mon Sep 17 00:00:00 2001 From: Aaron Patterson Date: Fri, 16 Aug 2019 16:04:26 -0700 Subject: Directly mark compile options from the AST object `rb_ast_t` holds a reference to this object, so it should mark the object. Currently it is relying on the `mark_ary` on `node_buffer` to ensure that the object stays alive. But since the array internals can move, this could cause a segv if compaction impacts the array. --- node.c | 1 + 1 file changed, 1 insertion(+) (limited to 'node.c') diff --git a/node.c b/node.c index 99558319f8..4c2810b0e2 100644 --- a/node.c +++ b/node.c @@ -1184,6 +1184,7 @@ void rb_ast_mark(rb_ast_t *ast) { if (ast->node_buffer) rb_gc_mark(ast->node_buffer->mark_ary); + if (ast->body.compile_option) rb_gc_mark(ast->body.compile_option); } void -- cgit v1.2.1