Revision: 155
http://www.exim.org/viewvc/pcre2?view=rev&revision=155
Author: ph10
Date: 2014-11-20 17:39:28 +0000 (Thu, 20 Nov 2014)
Log Message:
-----------
Eliminate a compiler warning.
Modified Paths:
--------------
code/trunk/src/pcre2test.c
Modified: code/trunk/src/pcre2test.c
===================================================================
--- code/trunk/src/pcre2test.c 2014-11-19 11:17:20 UTC (rev 154)
+++ code/trunk/src/pcre2test.c 2014-11-20 17:39:28 UTC (rev 155)
@@ -4926,6 +4926,21 @@
ovector = FLD(match_data, ovector);
+ /* After the first time round a global loop, save the current ovector[0,1] so
+ that we can check that they do change each time. Otherwise a matching bug
+ that returns the same string causes an infinite loop. It has happened! */
+
+ if (gmatched > 0)
+ {
+ ovecsave[0] = ovector[0];
+ ovecsave[1] = ovector[1];
+ }
+
+ /* Set the variables on the first iteration, just to stop a compiler warning
+ when ovecsave[] is referenced below. */
+
+ else ovecsave[0] = ovecsave[1] = 0;
+
/* Fill the ovector with junk to detect elements that do not get set
when they should be. */
@@ -4936,16 +4951,6 @@
jit_was_used = (pat_patctl.control & CTL_JITFAST) != 0;
- /* After the first time round a global loop, save the current ovector[0,1] so
- that we can check that they do change each time. Otherwise a matching bug
- that returns the same string causes an infinite loop. It has happened! */
-
- if (gmatched > 0)
- {
- ovecsave[0] = ovector[0];
- ovecsave[1] = ovector[1];
- }
-
/* Do timing if required. */
if (timeitm > 0)