summaryrefslogtreecommitdiff
path: root/re.c
diff options
context:
space:
mode:
Diffstat (limited to 're.c')
-rw-r--r--re.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/re.c b/re.c
index 6f4dcc2ff2..a28ac4a235 100644
--- a/re.c
+++ b/re.c
@@ -1145,6 +1145,7 @@ rb_reg_clone(re)
NEWOBJ(clone, struct RRegexp);
CLONESETUP(clone, re);
rb_reg_check(re);
+ clone->ptr = 0; clone->len = 0;
rb_reg_initialize(clone, RREGEXP(re)->str, RREGEXP(re)->len,
rb_reg_options(re));
return (VALUE)re;