Subject: | clash with qr/(?{})/ in 5.17.1+ |
Date: | Fri, 15 Mar 2013 10:29:53 +0000 |
To: | bug-Devel-Declare [...] rt.cpan.org |
From: | Zefram <zefram [...] fysh.org> |
In perl 5.17.1 and higher, if a /(?{})/ construct is compiled while
Devel::Declare is loaded, DD's block hook gets invoked with PL_linestr
being the contents of the regexp as it is being parsed, and when it
reallocates the SV buffer to accommodate DD insertions this invalidates
pointers that the regexp compiler has into the buffer. Results in memory
corruption; various failure modes I've seen include getting garbage
in the regexp and attempting to allocate more memory than is possible.
Workaround is to limit the PL_linestr reallocation to normal code parsing.
Unfortunate side effect is that DDed syntax can't be used inside /(?{})/,
but that's not an appalling imposition. Patch attached.
-zefram
Message body is not shown because sender requested not to inline it.