Skip to content

Commit 703c388

Browse files
committed
In Perl_reg_temp_copy(), ensure SvMAGIC() is NULL in the new REGEXP.
Change c2123ae exposed the fact that Perl_reg_temp_copy() didn't reset SvMAGIC() to NULL after block copying the "parent" regexp. The analagous problem with SvSTASH() was fixed with change b9ad13a.
1 parent 4d52295 commit 703c388

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

regcomp.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9461,6 +9461,7 @@ Perl_reg_temp_copy (pTHX_ REGEXP *ret_x, REGEXP *rx)
94619461
sizeof(regexp) - STRUCT_OFFSET(regexp, xpv_cur));
94629462
SvLEN_set(ret_x, 0);
94639463
SvSTASH_set(ret_x, NULL);
9464+
SvMAGIC_set(ret_x, NULL);
94649465
Newx(ret->offs, npar, regexp_paren_pair);
94659466
Copy(r->offs, ret->offs, npar, regexp_paren_pair);
94669467
if (r->substrs) {

0 commit comments

Comments
 (0)