aboutsummaryrefslogtreecommitdiffstats
path: root/re.c
diff options
context:
space:
mode:
Diffstat (limited to 're.c')
-rw-r--r--re.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/re.c b/re.c
index 4867104250..90dae9ba9e 100644
--- a/re.c
+++ b/re.c
@@ -1510,6 +1510,10 @@ match_inspect(VALUE match)
struct backref_name_tag *names;
VALUE regexp = RMATCH(match)->regexp;
+ if (regexp == 0) {
+ return rb_sprintf("#<%s:%p>", cname, (void*)match);
+ }
+
names = ALLOCA_N(struct backref_name_tag, num_regs);
MEMZERO(names, struct backref_name_tag, num_regs);