summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKarl Williamson <public@khwilliamson.com>2014-03-04 17:43:11 -0700
committerKarl Williamson <public@khwilliamson.com>2014-03-04 18:08:27 -0700
commit1ea8b7fed3b179aacae584e0c7389ab20fd4c388 (patch)
treedb87fac8d090177cf992499cdca1b741ce85a085
parent6ed60307ec0bd14728ad72c8f6fb4c27112cbff6 (diff)
downloadperl-1ea8b7fed3b179aacae584e0c7389ab20fd4c388.tar.gz
regcomp.c: Don't read uninitialized data
The blamed commit failed to check whether the data is present before reading it. I believe that this creates false positives in te optimizer, so no actual failures ensued.
-rw-r--r--regcomp.c8
1 files changed, 5 insertions, 3 deletions
diff --git a/regcomp.c b/regcomp.c
index 91b0b90dc1..2c94b4354e 100644
--- a/regcomp.c
+++ b/regcomp.c
@@ -1271,7 +1271,9 @@ S_ssc_and(pTHX_ const RExC_state_t *pRExC_state, regnode_ssc *ssc,
|| (ANYOF_FLAGS(and_with) & ANYOF_POSIXL))
{
/* One or the other of P1, P2 is non-empty. */
- ANYOF_POSIXL_AND((regnode_charclass_posixl*) and_with, ssc);
+ if (ANYOF_FLAGS(and_with) & ANYOF_POSIXL) {
+ ANYOF_POSIXL_AND((regnode_charclass_posixl*) and_with, ssc);
+ }
ssc_union(ssc, anded_cp_list, FALSE);
}
else { /* P1 = P2 = empty */
@@ -1331,8 +1333,8 @@ S_ssc_or(pTHX_ const RExC_state_t *pRExC_state, regnode_ssc *ssc,
&& ! is_ANYOF_SYNTHETIC(or_with))
{
/* We ignore P2, leaving P1 going forward */
- }
- else { /* Not inverted */
+ } /* else Not inverted */
+ else if (ANYOF_FLAGS(or_with) & ANYOF_POSIXL) {
ANYOF_POSIXL_OR((regnode_charclass_posixl*)or_with, ssc);
if (ANYOF_POSIXL_SSC_TEST_ANY_SET(ssc)) {
unsigned int i;