dup'd regexp would be pointing somewhere la-la. Probably at the precomp
of the same regexp in the parent thread. (So it is only likely to go
nasal daemon if the parent thread terminates first, or explicitly goes
around freeing up run time generated regexps.)
p4raw-id: //depot/perl@32754
dVAR;
regexp *ret;
I32 npar;
+ U32 precomp_offset;
if (!r)
return (REGEXP *)NULL;
}
}
+ precomp_offset = RX_PRECOMP(ret) - ret->wrapped;
+
ret->wrapped = SAVEPVN(ret->wrapped, ret->wraplen+1);
- RX_PRECOMP(ret) = ret->wrapped + (RX_PRECOMP(ret) - ret->wrapped);
+ RX_PRECOMP(ret) = ret->wrapped + precomp_offset;
ret->paren_names = hv_dup_inc(ret->paren_names, param);
if (ret->pprivate)