summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorph10 <ph10@2f5784b3-3f2a-0410-8824-cb99058d5e15>2016-05-20 10:33:36 +0000
committerph10 <ph10@2f5784b3-3f2a-0410-8824-cb99058d5e15>2016-05-20 10:33:36 +0000
commit166adb37b3b516b4a629030ef39f1b5da32bc185 (patch)
treecb13f08d9a30133f34e59eedc0578cc70804bf23
parent1985a2d4dd5c40128d8ab3517b2003535b0c8acb (diff)
downloadpcre-166adb37b3b516b4a629030ef39f1b5da32bc185.tar.gz
Minor refactor to avoid compiler warning.
git-svn-id: svn://vcs.exim.org/pcre/code/trunk@1648 2f5784b3-3f2a-0410-8824-cb99058d5e15
-rw-r--r--ChangeLog3
-rw-r--r--pcre_compile.c18
2 files changed, 12 insertions, 9 deletions
diff --git a/ChangeLog b/ChangeLog
index 24e35e5..c2c3921 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -81,6 +81,9 @@ Version 8.39 xx-xxxxxx-201x
20. A racing condition is fixed in JIT reported by Mozilla.
+21. Minor code refactor to avoid "array subscript is below array bounds"
+compiler warning.
+
Version 8.38 23-November-2015
-----------------------------
diff --git a/pcre_compile.c b/pcre_compile.c
index 254c629..ec202fd 100644
--- a/pcre_compile.c
+++ b/pcre_compile.c
@@ -4566,6 +4566,10 @@ for (;; ptr++)
unsigned int tempbracount;
pcre_uint32 ec;
pcre_uchar mcbuffer[8];
+
+ /* Come here to restart the loop without advancing the pointer. */
+
+ REDO_LOOP:
/* Get next character in the pattern */
@@ -4712,11 +4716,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. We need to do this here because we want to know if
@@ -4857,15 +4857,15 @@ for (;; ptr++)
if (STRNCMP_UC_C8(ptr+1, STRING_WEIRD_STARTWORD, 6) == 0)
{
nestptr = ptr + 7;
- ptr = sub_start_of_word - 1;
- continue;
+ ptr = sub_start_of_word;
+ goto REDO_LOOP;
}
if (STRNCMP_UC_C8(ptr+1, STRING_WEIRD_ENDWORD, 6) == 0)
{
nestptr = ptr + 7;
- ptr = sub_end_of_word - 1;
- continue;
+ ptr = sub_end_of_word;
+ goto REDO_LOOP;
}
/* Handle a real character class. */