Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[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].
- Loading branch information
Showing
10 changed files
with
359 additions
and
231 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.