Fix oversights in recent non-atomic assertions patch. Fixes ClusterFuzz 15837.
This commit is contained in:
parent
4677b1b0bb
commit
66811c6c73
|
@ -4738,6 +4738,7 @@ for (;;)
|
||||||
case OP_ASSERT_NOT:
|
case OP_ASSERT_NOT:
|
||||||
case OP_ASSERTBACK:
|
case OP_ASSERTBACK:
|
||||||
case OP_ASSERTBACK_NOT:
|
case OP_ASSERTBACK_NOT:
|
||||||
|
case OP_ASSERTBACK_NA:
|
||||||
if (!skipassert) return code;
|
if (!skipassert) return code;
|
||||||
do code += GET(code, 1); while (*code == OP_ALT);
|
do code += GET(code, 1); while (*code == OP_ALT);
|
||||||
code += PRIV(OP_lengths)[*code];
|
code += PRIV(OP_lengths)[*code];
|
||||||
|
@ -6428,7 +6429,7 @@ for (;; pptr++)
|
||||||
|
|
||||||
/* If we've just compiled an assertion, pop the assert depth. */
|
/* If we've just compiled an assertion, pop the assert depth. */
|
||||||
|
|
||||||
if (bravalue >= OP_ASSERT && bravalue <= OP_ASSERTBACK_NOT)
|
if (bravalue >= OP_ASSERT && bravalue <= OP_ASSERTBACK_NA)
|
||||||
cb->assert_depth -= 1;
|
cb->assert_depth -= 1;
|
||||||
|
|
||||||
/* At the end of compiling, code is still pointing to the start of the
|
/* At the end of compiling, code is still pointing to the start of the
|
||||||
|
@ -6578,8 +6579,8 @@ for (;; pptr++)
|
||||||
we must only take the reqcu when the group also set a firstcu. Otherwise,
|
we must only take the reqcu when the group also set a firstcu. Otherwise,
|
||||||
in that example, 'X' ends up set for both. */
|
in that example, 'X' ends up set for both. */
|
||||||
|
|
||||||
else if (bravalue == OP_ASSERT && subreqcuflags >= 0 &&
|
else if ((bravalue == OP_ASSERT || bravalue == OP_ASSERT_NA) &&
|
||||||
subfirstcuflags >= 0)
|
subreqcuflags >= 0 && subfirstcuflags >= 0)
|
||||||
{
|
{
|
||||||
reqcu = subreqcu;
|
reqcu = subreqcu;
|
||||||
reqcuflags = subreqcuflags;
|
reqcuflags = subreqcuflags;
|
||||||
|
@ -7013,8 +7014,10 @@ for (;; pptr++)
|
||||||
|
|
||||||
case OP_ASSERT:
|
case OP_ASSERT:
|
||||||
case OP_ASSERT_NOT:
|
case OP_ASSERT_NOT:
|
||||||
|
case OP_ASSERT_NA:
|
||||||
case OP_ASSERTBACK:
|
case OP_ASSERTBACK:
|
||||||
case OP_ASSERTBACK_NOT:
|
case OP_ASSERTBACK_NOT:
|
||||||
|
case OP_ASSERTBACK_NA:
|
||||||
case OP_ONCE:
|
case OP_ONCE:
|
||||||
case OP_SCRIPT_RUN:
|
case OP_SCRIPT_RUN:
|
||||||
case OP_BRA:
|
case OP_BRA:
|
||||||
|
@ -8266,7 +8269,7 @@ do {
|
||||||
|
|
||||||
/* Positive forward assertion */
|
/* Positive forward assertion */
|
||||||
|
|
||||||
else if (op == OP_ASSERT)
|
else if (op == OP_ASSERT || op == OP_ASSERT_NA)
|
||||||
{
|
{
|
||||||
if (!is_anchored(scode, bracket_map, cb, atomcount, TRUE)) return FALSE;
|
if (!is_anchored(scode, bracket_map, cb, atomcount, TRUE)) return FALSE;
|
||||||
}
|
}
|
||||||
|
@ -8404,7 +8407,7 @@ do {
|
||||||
|
|
||||||
/* Positive forward assertions */
|
/* Positive forward assertions */
|
||||||
|
|
||||||
else if (op == OP_ASSERT)
|
else if (op == OP_ASSERT || op == OP_ASSERT_NA)
|
||||||
{
|
{
|
||||||
if (!is_startline(scode, bracket_map, cb, atomcount, TRUE))
|
if (!is_startline(scode, bracket_map, cb, atomcount, TRUE))
|
||||||
return FALSE;
|
return FALSE;
|
||||||
|
@ -8646,9 +8649,11 @@ do {
|
||||||
case OP_CBRAPOS:
|
case OP_CBRAPOS:
|
||||||
case OP_SCBRAPOS:
|
case OP_SCBRAPOS:
|
||||||
case OP_ASSERT:
|
case OP_ASSERT:
|
||||||
|
case OP_ASSERT_NA:
|
||||||
case OP_ONCE:
|
case OP_ONCE:
|
||||||
case OP_SCRIPT_RUN:
|
case OP_SCRIPT_RUN:
|
||||||
d = find_firstassertedcu(scode, &dflags, inassert + ((op==OP_ASSERT)?1:0));
|
d = find_firstassertedcu(scode, &dflags, inassert +
|
||||||
|
((op == OP_ASSERT || op == OP_ASSERT_NA)?1:0));
|
||||||
if (dflags < 0)
|
if (dflags < 0)
|
||||||
return 0;
|
return 0;
|
||||||
if (cflags < 0) { c = d; cflags = dflags; }
|
if (cflags < 0) { c = d; cflags = dflags; }
|
||||||
|
|
|
@ -5680,6 +5680,14 @@ a)"xI
|
||||||
|
|
||||||
/(*napla:ab+)/B
|
/(*napla:ab+)/B
|
||||||
|
|
||||||
|
/(*napla:)+/
|
||||||
|
|
||||||
|
/(*naplb:)+/
|
||||||
|
|
||||||
|
/(*napla:^x|^y)/I
|
||||||
|
|
||||||
|
/(*napla:abc|abd)/I
|
||||||
|
|
||||||
# ----
|
# ----
|
||||||
|
|
||||||
# End of testinput2
|
# End of testinput2
|
||||||
|
|
|
@ -17165,6 +17165,24 @@ No match
|
||||||
End
|
End
|
||||||
------------------------------------------------------------------
|
------------------------------------------------------------------
|
||||||
|
|
||||||
|
/(*napla:)+/
|
||||||
|
|
||||||
|
/(*naplb:)+/
|
||||||
|
|
||||||
|
/(*napla:^x|^y)/I
|
||||||
|
Capture group count = 0
|
||||||
|
May match empty string
|
||||||
|
Compile options: <none>
|
||||||
|
Overall options: anchored
|
||||||
|
Starting code units: x y
|
||||||
|
Subject length lower bound = 0
|
||||||
|
|
||||||
|
/(*napla:abc|abd)/I
|
||||||
|
Capture group count = 0
|
||||||
|
May match empty string
|
||||||
|
First code unit = 'a'
|
||||||
|
Subject length lower bound = 1
|
||||||
|
|
||||||
# ----
|
# ----
|
||||||
|
|
||||||
# End of testinput2
|
# End of testinput2
|
||||||
|
|
Loading…
Reference in New Issue