summaryrefslogtreecommitdiff
path: root/iseq.c
diff options
context:
space:
mode:
authornobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2016-01-13 07:56:51 +0000
committernobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2016-01-13 07:56:51 +0000
commit22121544e16ce6ad127712a79d6b69ef785c222e (patch)
tree4bb312c3636a1a18b30e1e737e937a2a424e5108 /iseq.c
parentbe4501bf3a8891533725288016e29ef7b63ea345 (diff)
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
Diffstat (limited to 'iseq.c')
-rw-r--r--iseq.c5
1 files changed, 1 insertions, 4 deletions
diff --git a/iseq.c b/iseq.c
index 8b75ac6..b8ae57b 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