diff options
author | Karl Williamson <khw@cpan.org> | 2020-02-17 12:07:07 -0700 |
---|---|---|
committer | Karl Williamson <khw@cpan.org> | 2020-02-19 18:18:40 -0700 |
commit | d8d1dede53afc4f33cf63203b0992459fe964dc3 (patch) | |
tree | 4ef95497f184f170a82322bd09f7720887d38711 /embed.h | |
parent | 9f55257555c98b527185e6747eb633b2bdb70c0b (diff) | |
download | perl-d8d1dede53afc4f33cf63203b0992459fe964dc3.tar.gz |
Improve handling of nested qr/(?[...])/
A set operations expression can contain a previously-compiled one
interpolated in. Prior to this commit, some heuristics were employed
to verify it actually was such a thing, and not a sort of look-alike
that wasn't necessarily valid. The heuristics actually forbade legal
ones. I don't know of any illegal ones that were let through, but it is
certainly possible. Also, the error/warning messages referred to the
heuristics, and were unhelpful at best.
The technique used instead in this commit is to return a regop only used
by this feature for any nested compilations. This guarantees that the
caller can determine if the result is valid, and what that result is
without having to do any heuristics or inspecting any flags. The
error/warning messages are changed to reflect this, and I believe are
now helpful.
This fixes the bugs in #16779
https://github.com/Perl/perl5/issues/16779#issuecomment-563987618
Diffstat (limited to 'embed.h')
-rw-r--r-- | embed.h | 1 |
1 files changed, 1 insertions, 0 deletions
@@ -1052,6 +1052,7 @@ #define reginsert(a,b,c,d) S_reginsert(aTHX_ a,b,c,d) #define regnode_guts(a,b,c,d) S_regnode_guts(aTHX_ a,b,c,d) #define regpiece(a,b,c) S_regpiece(aTHX_ a,b,c) +#define regpnode(a,b,c) S_regpnode(aTHX_ a,b,c) #define regtail(a,b,c,d) S_regtail(aTHX_ a,b,c,d) #define scan_commit(a,b,c,d) S_scan_commit(aTHX_ a,b,c,d) #define set_ANYOF_arg(a,b,c,d,e) S_set_ANYOF_arg(aTHX_ a,b,c,d,e) |