summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorph10 <ph10@6239d852-aaf2-0410-a92c-79f79f948069>2016-05-20 10:47:42 +0000
committerph10 <ph10@6239d852-aaf2-0410-a92c-79f79f948069>2016-05-20 10:47:42 +0000
commit15ab7c4b287ea6f617f04e9396a00bd90fb22b05 (patch)
tree5a8f289546bf2d08de7092ae9fc0559ed0eb6c7d
parent78c2458423ce34b08dd0a119b774e37c908d57ef (diff)
downloadpcre2-15ab7c4b287ea6f617f04e9396a00bd90fb22b05.tar.gz
Minor code refactor to avoid compiler warning.
git-svn-id: svn://vcs.exim.org/pcre2/code/trunk@515 6239d852-aaf2-0410-a92c-79f79f948069
-rw-r--r--ChangeLog4
-rw-r--r--src/pcre2_compile.c20
2 files changed, 13 insertions, 11 deletions
diff --git a/ChangeLog b/ChangeLog
index 754d0e5..87ceb27 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -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.
+26. Minor code refactor to avoid "array subscript is below array bounds"
+compiler warning.
+
+
Version 10.21 12-January-2016
-----------------------------
diff --git a/src/pcre2_compile.c b/src/pcre2_compile.c
index baaff3d..779c1a2 100644
--- a/src/pcre2_compile.c
+++ b/src/pcre2_compile.c
@@ -3962,6 +3962,10 @@ for (;; ptr++)
uint32_t subreqcu, subfirstcu;
int32_t subreqcuflags, subfirstcuflags; /* Must be signed */
PCRE2_UCHAR mcbuffer[8];
+
+ /* Come here to restart the loop. */
+
+ REDO_LOOP:
/* 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
a comment. */
- if (ptr > wscptr)
- {
- ptr--;
- continue;
- }
+ if (ptr > wscptr) goto REDO_LOOP;
}
/* Skip over (?# comments. */
@@ -4247,17 +4247,15 @@ for (;; ptr++)
if (PRIV(strncmp_c8)(ptr+1, STRING_WEIRD_STARTWORD, 6) == 0)
{
cb->nestptr[0] = ptr + 7;
- ptr = sub_start_of_word; /* Do not combine these statements; clang's */
- ptr--; /* sanitizer moans about a negative index. */
- continue;
+ ptr = sub_start_of_word;
+ goto REDO_LOOP;
}
if (PRIV(strncmp_c8)(ptr+1, STRING_WEIRD_ENDWORD, 6) == 0)
{
cb->nestptr[0] = ptr + 7;
- ptr = sub_end_of_word; /* Do not combine these statements; clang's */
- ptr--; /* sanitizer moans about a negative index. */
- continue;
+ ptr = sub_end_of_word;
+ goto REDO_LOOP;
}
/* Handle a real character class. */