From 22121544e16ce6ad127712a79d6b69ef785c222e Mon Sep 17 00:00:00 2001 From: nobu Date: Wed, 13 Jan 2016 07:56:51 +0000 Subject: iseq.c: mark parent iseq * iseq.c (rb_iseq_mark): mark parent iseq to prevent dynamically generated iseq by eval from GC. [ruby-core:72620] [Bug #11928] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@53524 b2dd03c8-39d4-4d8f-98ff-823fe69b080e --- iseq.c | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) (limited to 'iseq.c') diff --git a/iseq.c b/iseq.c index 8b75ac6cbd..b8ae57b782 100644 --- a/iseq.c +++ b/iseq.c @@ -113,6 +113,7 @@ rb_iseq_mark(const rb_iseq_t *iseq) rb_gc_mark(body->location.base_label); rb_gc_mark(body->location.path); RUBY_MARK_UNLESS_NULL(body->location.absolute_path); + RUBY_MARK_UNLESS_NULL((VALUE)body->parent_iseq); } if (FL_TEST(iseq, ISEQ_NOT_LOADED_YET)) { @@ -711,11 +712,7 @@ rb_iseq_coverage(const rb_iseq_t *iseq) static void iseqw_mark(void *ptr) { - const rb_iseq_t *iseq = ptr; rb_gc_mark((VALUE)ptr); - while ((iseq = iseq->body->parent_iseq) != NULL) { - rb_gc_mark((VALUE)iseq); - } } static size_t -- cgit v1.2.3