summaryrefslogtreecommitdiff
path: root/parser.h
diff options
context:
space:
mode:
authorFather Chrysostomos <sprout@cpan.org>2016-08-02 23:58:52 -0700
committerFather Chrysostomos <sprout@cpan.org>2016-08-03 00:40:44 -0700
commit7ef70b3d59ec815fef24083df58e1ce363c63287 (patch)
tree9b7ce4723a32968a53204870adad42a9207af06f /parser.h
parent53225858d8a26c52154c06943d0ee5227573617c (diff)
downloadperl-7ef70b3d59ec815fef24083df58e1ce363c63287.tar.gz
Empty sublex_info into the parser struct
sublex_info is never validly copied or set* all at once and no pointer is ever taken to it. It seems to be left over from the time when PL_sublex_info was a global variable. (Indeed, the struct is still defined in perl.h, an odd place for something used only by parser.h.) It will be easier to eliminate alignment holes in the parser struct if we just empty it out. * The one instance of sublex_info being copied, in sv.c:Perl_parser_dup, ended up potentially sharing an SV between threads, which is a no-no. I say potentially, because I can’t see how it could be non-null during thread cloning, which would have to happen between sublex_start and sublex_push.
Diffstat (limited to 'parser.h')
-rw-r--r--parser.h5
1 files changed, 4 insertions, 1 deletions
diff --git a/parser.h b/parser.h
index 5d0f0025b3..135051d87f 100644
--- a/parser.h
+++ b/parser.h
@@ -72,7 +72,10 @@ typedef struct yy_parser {
bool preambled;
bool lex_re_reparsing; /* we're doing G_RE_REPARSING */
I32 lex_allbrackets;/* (), [], {}, ?: bracket count */
- SUBLEXINFO sublex_info;
+ U8 lex_super_state;/* lexer state to save */
+ U16 lex_sub_inwhat; /* "lex_inwhat" to use in sublex_push */
+ OP *lex_sub_op; /* current op in y/// or pattern */
+ SV *lex_sub_repl; /* repl of s/// used in sublex_push */
LEXSHARED *lex_shared;
SV *linestr; /* current chunk of src text */
char *bufptr; /* carries the cursor (current parsing