Eliminate a compiler warning.

This commit is contained in:
Philip.Hazel 2014-11-20 17:39:28 +00:00
parent eea35d0cab
commit 69176e79a5
1 changed files with 15 additions and 10 deletions

View File

@ -4926,16 +4926,6 @@ else for (gmatched = 0;; gmatched++)
ovector = FLD(match_data, ovector); ovector = FLD(match_data, ovector);
/* Fill the ovector with junk to detect elements that do not get set
when they should be. */
for (j = 0; j < 2*dat_datctl.oveccount; j++) ovector[j] = JUNK_OFFSET;
/* When matching is via pcre2_match(), we will detect the use of JIT via the
stack callback function. */
jit_was_used = (pat_patctl.control & CTL_JITFAST) != 0;
/* After the first time round a global loop, save the current ovector[0,1] so /* 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 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! */ that returns the same string causes an infinite loop. It has happened! */
@ -4946,6 +4936,21 @@ else for (gmatched = 0;; gmatched++)
ovecsave[1] = ovector[1]; 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. */
for (j = 0; j < 2*dat_datctl.oveccount; j++) ovector[j] = JUNK_OFFSET;
/* When matching is via pcre2_match(), we will detect the use of JIT via the
stack callback function. */
jit_was_used = (pat_patctl.control & CTL_JITFAST) != 0;
/* Do timing if required. */ /* Do timing if required. */
if (timeitm > 0) if (timeitm > 0)