From 7ef70b3d59ec815fef24083df58e1ce363c63287 Mon Sep 17 00:00:00 2001 From: Father Chrysostomos Date: Tue, 2 Aug 2016 23:58:52 -0700 Subject: Empty sublex_info into the parser struct MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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. --- perl.h | 8 -------- 1 file changed, 8 deletions(-) (limited to 'perl.h') diff --git a/perl.h b/perl.h index 218f94c74d..1a38933ec9 100644 --- a/perl.h +++ b/perl.h @@ -3919,14 +3919,6 @@ typedef struct crypt_data { /* straight from /usr/include/crypt.h */ #undef _XPVMG_HEAD #undef _XPVCV_COMMON -typedef struct _sublex_info SUBLEXINFO; -struct _sublex_info { - U8 super_state; /* lexer state to save */ - U16 sub_inwhat; /* "lex_inwhat" to use */ - OP *sub_op; /* "lex_op" to use */ - SV *repl; /* replacement of s/// or y/// */ -}; - #include "parser.h" typedef struct magic_state MGS; /* struct magic_state defined in mg.c */ -- cgit v1.2.1