Minor code refactor to avoid compiler warning.

This commit is contained in:
Philip.Hazel 2016-05-20 10:47:42 +00:00
parent 7650161677
commit bf1587490b
2 changed files with 13 additions and 11 deletions

View File

@ -108,6 +108,10 @@ been re-factored and no longer includes pcre2_internal.h.
25. A racing condition is fixed in JIT reported by Mozilla. 25. A racing condition is fixed in JIT reported by Mozilla.
26. Minor code refactor to avoid "array subscript is below array bounds"
compiler warning.
Version 10.21 12-January-2016 Version 10.21 12-January-2016
----------------------------- -----------------------------

View File

@ -3962,6 +3962,10 @@ for (;; ptr++)
uint32_t subreqcu, subfirstcu; uint32_t subreqcu, subfirstcu;
int32_t subreqcuflags, subfirstcuflags; /* Must be signed */ int32_t subreqcuflags, subfirstcuflags; /* Must be signed */
PCRE2_UCHAR mcbuffer[8]; PCRE2_UCHAR mcbuffer[8];
/* Come here to restart the loop. */
REDO_LOOP:
/* Get next character in the pattern */ /* Get next character in the pattern */
@ -4103,11 +4107,7 @@ for (;; ptr++)
/* If we skipped any characters, restart the loop. Otherwise, we didn't see /* If we skipped any characters, restart the loop. Otherwise, we didn't see
a comment. */ a comment. */
if (ptr > wscptr) if (ptr > wscptr) goto REDO_LOOP;
{
ptr--;
continue;
}
} }
/* Skip over (?# comments. */ /* Skip over (?# comments. */
@ -4247,17 +4247,15 @@ for (;; ptr++)
if (PRIV(strncmp_c8)(ptr+1, STRING_WEIRD_STARTWORD, 6) == 0) if (PRIV(strncmp_c8)(ptr+1, STRING_WEIRD_STARTWORD, 6) == 0)
{ {
cb->nestptr[0] = ptr + 7; cb->nestptr[0] = ptr + 7;
ptr = sub_start_of_word; /* Do not combine these statements; clang's */ ptr = sub_start_of_word;
ptr--; /* sanitizer moans about a negative index. */ goto REDO_LOOP;
continue;
} }
if (PRIV(strncmp_c8)(ptr+1, STRING_WEIRD_ENDWORD, 6) == 0) if (PRIV(strncmp_c8)(ptr+1, STRING_WEIRD_ENDWORD, 6) == 0)
{ {
cb->nestptr[0] = ptr + 7; cb->nestptr[0] = ptr + 7;
ptr = sub_end_of_word; /* Do not combine these statements; clang's */ ptr = sub_end_of_word;
ptr--; /* sanitizer moans about a negative index. */ goto REDO_LOOP;
continue;
} }
/* Handle a real character class. */ /* Handle a real character class. */