summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDavid Mitchell <davem@iabyn.com>2012-05-21 20:44:50 +0100
committerDavid Mitchell <davem@iabyn.com>2012-06-13 13:32:53 +0100
commitf067efbfa97c3658b1cf186884f09e38fcee1876 (patch)
treede27dec10a993daa616ba691e3bacae956dc9a7b
parent495f47a5a58f41f475461921fbfb6566ffa94ee1 (diff)
downloadperl-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.fnc2
-rw-r--r--proto.h2
-rw-r--r--regexec.c8
3 files changed, 4 insertions, 8 deletions
diff --git a/embed.fnc b/embed.fnc
index 551f14a95e..f7444e9f55 100644
--- a/embed.fnc
+++ b/embed.fnc
@@ -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 \
diff --git a/proto.h b/proto.h
index da48b0e631..bd23296772 100644
--- a/proto.h
+++ b/proto.h
@@ -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)
diff --git a/regexec.c b/regexec.c
index 5b987eec83..76ad57db28 100644
--- a/regexec.c
+++ b/regexec.c
@@ -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. */