summaryrefslogtreecommitdiff
path: root/eval.c
diff options
context:
space:
mode:
Diffstat (limited to 'eval.c')
-rw-r--r--eval.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/eval.c b/eval.c
index 9ac63889cf..c5a72dc609 100644
--- a/eval.c
+++ b/eval.c
@@ -274,7 +274,8 @@ rb_mod_nesting(void)
while (cref && cref->nd_next) {
VALUE klass = cref->nd_clss;
- if (!NIL_P(klass)) {
+ if (!(cref->flags & NODE_FL_CREF_PUSHED_BY_EVAL) &&
+ !NIL_P(klass)) {
rb_ary_push(ary, klass);
}
cref = cref->nd_next;