This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
[MERGE] handle /(?{})/ with overload::constant qr
The reworking of the re_eval implementation for 5.17.1 made the assumption
that constant strings within literal patterns were, um, constant.
It turns out this this is an invalid assumption, because
overload::constant qr => { sub return bless [], 'Foo' }
can cause the constant bits of a pattern, like foo, bar in
/foo(?{...})bar/
to get replaced with (for example) blessed objects: so the 'constant' SV
attached to an OP_CONST is actually a blessed object, that could itself be
overloaded with string or concat methods say, or could be a qr// object
etc.
The commits in this merge (hopefully) fix the various problems this
assumption caused: chiefly with qr// objects containing compiled (?{})
code that were getting re-stringified and thus failing unless in the
presence of use re 'eval' (and sometimes failing even in its presence).
Also, runtime patterns could trigger a recursive call to the overload
method, and eventually stack overflow and SEGV.
See [perl #116823].