diff options
author | ph10 <ph10@6239d852-aaf2-0410-a92c-79f79f948069> | 2014-11-20 17:39:28 +0000 |
---|---|---|
committer | ph10 <ph10@6239d852-aaf2-0410-a92c-79f79f948069> | 2014-11-20 17:39:28 +0000 |
commit | d5898bf3e210fc2c72e165724ae04aa7de0ae08c (patch) | |
tree | d6450a82a52b0bf0c0ee744358838a32c41cd9ea | |
parent | 79642eba0eccbc4e54f4bcbe1fca680bd623af9c (diff) | |
download | pcre2-d5898bf3e210fc2c72e165724ae04aa7de0ae08c.tar.gz |
Eliminate a compiler warning.
git-svn-id: svn://vcs.exim.org/pcre2/code/trunk@155 6239d852-aaf2-0410-a92c-79f79f948069
-rw-r--r-- | src/pcre2test.c | 25 |
1 files changed, 15 insertions, 10 deletions
diff --git a/src/pcre2test.c b/src/pcre2test.c index f2c4053..83f0447 100644 --- a/src/pcre2test.c +++ b/src/pcre2test.c @@ -4926,16 +4926,6 @@ else for (gmatched = 0;; gmatched++) 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 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! */ @@ -4946,6 +4936,21 @@ else for (gmatched = 0;; gmatched++) 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. */ if (timeitm > 0) |