This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
Guard cur_curlyx at least with an assert.
authorJarkko Hietaniemi <jhi@iki.fi>
Sat, 28 Jun 2014 00:15:26 +0000 (20:15 -0400)
committerJarkko Hietaniemi <jhi@iki.fi>
Sat, 28 Jun 2014 00:15:26 +0000 (20:15 -0400)
Keep on keeping Coverity happy (Coverity perl5 CID 45352).

regexec.c

index 0fc53c9..88615a4 100644 (file)
--- a/regexec.c
+++ b/regexec.c
@@ -5791,11 +5791,14 @@ NULL
        {
            /* see the discussion above about CURLYX/WHILEM */
            I32 n;
-           int min = ARG1(cur_curlyx->u.curlyx.me);
-           int max = ARG2(cur_curlyx->u.curlyx.me);
-           regnode *A = NEXTOPER(cur_curlyx->u.curlyx.me) + EXTRA_STEP_2ARGS;
+           int min, max;
+           regnode *A;
 
            assert(cur_curlyx); /* keep Coverity happy */
+
+           min = ARG1(cur_curlyx->u.curlyx.me);
+           max = ARG2(cur_curlyx->u.curlyx.me);
+           A = NEXTOPER(cur_curlyx->u.curlyx.me) + EXTRA_STEP_2ARGS;
            n = ++cur_curlyx->u.curlyx.count; /* how many A's matched */
            ST.save_lastloc = cur_curlyx->u.curlyx.lastloc;
            ST.cache_offset = 0;