summaryrefslogtreecommitdiff
path: root/variable.c
diff options
context:
space:
mode:
Diffstat (limited to 'variable.c')
-rw-r--r--variable.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/variable.c b/variable.c
index e9735a8c4d..c6c70e1391 100644
--- a/variable.c
+++ b/variable.c
@@ -902,7 +902,7 @@ rb_f_global_variables(void)
int i, nmatch = rb_match_count(backref);
buf[0] = '$';
for (i = 1; i <= nmatch; ++i) {
- if (!rb_match_nth_defined(i, backref)) continue;
+ if (!RTEST(rb_reg_nth_defined(i, backref))) continue;
if (i < 10) {
/* probably reused, make static ID */
buf[1] = (char)(i + '0');