summaryrefslogtreecommitdiff
path: root/iseq.c
diff options
context:
space:
mode:
authormame <mame@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2010-04-27 13:42:29 +0000
committermame <mame@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2010-04-27 13:42:29 +0000
commite02f7f79c23aaaf7c5878408a2b46b00f23c32ba (patch)
tree39e7ec97e86e686d1fb1d42f23bd8b39fc452bef /iseq.c
parent4af243a8afa0dfefc74bb68dd08d9c5ff3ccc5d5 (diff)
* iseq.c (set_relation): do not use top_wrapper as bottom of cref,
which caused constant lookup error when "wrapped load" is used; instead, use Object as bottom, and push top_wrapper on Object. [ruby-core:25039] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@27514 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'iseq.c')
-rw-r--r--iseq.c9
1 files changed, 8 insertions, 1 deletions
diff --git a/iseq.c b/iseq.c
index d6644f220f..c26850c045 100644
--- a/iseq.c
+++ b/iseq.c
@@ -177,9 +177,16 @@ set_relation(rb_iseq_t *iseq, const VALUE parent)
/* set class nest stack */
if (type == ISEQ_TYPE_TOP) {
/* toplevel is private */
- iseq->cref_stack = NEW_BLOCK(th->top_wrapper ? th->top_wrapper : rb_cObject);
+ iseq->cref_stack = NEW_BLOCK(rb_cObject);
iseq->cref_stack->nd_file = 0;
iseq->cref_stack->nd_visi = NOEX_PRIVATE;
+ if (th->top_wrapper) {
+ NODE *cref = NEW_BLOCK(th->top_wrapper);
+ cref->nd_file = 0;
+ cref->nd_visi = NOEX_PRIVATE;
+ cref->nd_next = iseq->cref_stack;
+ iseq->cref_stack = cref;
+ }
}
else if (type == ISEQ_TYPE_METHOD || type == ISEQ_TYPE_CLASS) {
iseq->cref_stack = NEW_BLOCK(0); /* place holder */