diff options
author | David Mitchell <davem@iabyn.com> | 2012-05-21 20:44:50 +0100 |
---|---|---|
committer | David Mitchell <davem@iabyn.com> | 2012-06-13 13:32:53 +0100 |
commit | f067efbfa97c3658b1cf186884f09e38fcee1876 (patch) | |
tree | de27dec10a993daa616ba691e3bacae956dc9a7b | |
parent | 495f47a5a58f41f475461921fbfb6566ffa94ee1 (diff) | |
download | perl-f067efbfa97c3658b1cf186884f09e38fcee1876.tar.gz |
S_regcppush/pop : don't save PL_reginput
currently, S_regcppush() pushes PL_reginput, then S_regcppop() pops its
value and returns it. However, all calls to S_regcppop() are currently in
void context, so nothing actually uses this value. So don't save it in the
first place.
-rw-r--r-- | embed.fnc | 2 | ||||
-rw-r--r-- | proto.h | 2 | ||||
-rw-r--r-- | regexec.c | 8 |
3 files changed, 4 insertions, 8 deletions
@@ -1997,7 +1997,7 @@ ERs |I32 |regtry |NN regmatch_info *reginfo|NN char **startpos ERs |bool |reginclass |NULLOK const regexp * const prog|NN const regnode * const n|NN const U8 * const p|NULLOK STRLEN *lenp\ |bool const do_utf8sv_is_utf8 Es |CHECKPOINT|regcppush |NN const regexp *rex|I32 parenfloor -Es |char* |regcppop |NN regexp *rex +Es |void |regcppop |NN regexp *rex ERsn |U8* |reghop3 |NN U8 *s|I32 off|NN const U8 *lim ERsM |SV* |core_regclass_swash|NULLOK const regexp *prog \ |NN const struct regnode *node|bool doinit \ @@ -6697,7 +6697,7 @@ STATIC I32 S_reg_check_named_buff_matched(pTHX_ const regexp *rex, const regnode #define PERL_ARGS_ASSERT_REG_CHECK_NAMED_BUFF_MATCHED \ assert(rex); assert(scan) -STATIC char* S_regcppop(pTHX_ regexp *rex) +STATIC void S_regcppop(pTHX_ regexp *rex) __attribute__nonnull__(pTHX_1); #define PERL_ARGS_ASSERT_REGCPPOP \ assert(rex) @@ -333,7 +333,7 @@ static void restore_pos(pTHX_ void *arg); #define REGCP_PAREN_ELEMS 4 -#define REGCP_OTHER_ELEMS 4 +#define REGCP_OTHER_ELEMS 3 #define REGCP_FRAME_ELEMS 1 /* REGCP_FRAME_ELEMS are not part of the REGCP_OTHER_ELEMS and * are needed for the regexp context stack bookkeeping. */ @@ -388,7 +388,6 @@ S_regcppush(pTHX_ const regexp *rex, I32 parenfloor) SSPUSHINT(PL_regsize); SSPUSHINT(rex->lastparen); SSPUSHINT(rex->lastcloseparen); - SSPUSHPTR(PL_reginput); SSPUSHUV(SAVEt_REGCONTEXT | elems_shifted); /* Magic cookie. */ return retval; @@ -410,12 +409,11 @@ S_regcppush(pTHX_ const regexp *rex, I32 parenfloor) (IV)(cp), (IV)PL_savestack_ix)); \ regcpblow(cp) -STATIC char * +STATIC void S_regcppop(pTHX_ regexp *rex) { dVAR; UV i; - char *input; GET_RE_DEBUG_FLAGS_DECL; PERL_ARGS_ASSERT_REGCPPOP; @@ -424,7 +422,6 @@ S_regcppop(pTHX_ regexp *rex) i = SSPOPUV; assert((i & SAVE_MASK) == SAVEt_REGCONTEXT); /* Check that the magic cookie is there. */ i >>= SAVE_TIGHT_SHIFT; /* Parentheses elements to pop. */ - input = (char *) SSPOPPTR; rex->lastcloseparen = SSPOPINT; rex->lastparen = SSPOPINT; PL_regsize = SSPOPINT; @@ -477,7 +474,6 @@ S_regcppop(pTHX_ regexp *rex) )); } #endif - return input; } #define regcpblow(cp) LEAVE_SCOPE(cp) /* Ignores regcppush()ed data. */ |