aboutsummaryrefslogtreecommitdiffstats
path: root/compile.c
diff options
context:
space:
mode:
Diffstat (limited to 'compile.c')
-rw-r--r--compile.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/compile.c b/compile.c
index 9a096ccf61..2c27d60d6e 100644
--- a/compile.c
+++ b/compile.c
@@ -2333,10 +2333,12 @@ defined_expr(rb_iseq_t *iseq, LINK_ANCHOR *ret,
needstr);
return 1;
+ case NODE_BACK_REF:
case NODE_NTH_REF:
ADD_INSN(ret, nd_line(node), putnil);
ADD_INSN3(ret, nd_line(node), defined, INT2FIX(DEFINED_REF),
- INT2FIX(node->nd_nth), needstr);
+ INT2FIX(node->nd_nth << 1 | type == NODE_BACK_REF),
+ needstr);
return 1;
case NODE_ZSUPER: