This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
regexec.c: (Coverity) move NULL check even earlier
authorJarkko Hietaniemi <jhi@iki.fi>
Thu, 13 Apr 2006 15:39:33 +0000 (18:39 +0300)
committerNicholas Clark <nick@ccl4.org>
Thu, 13 Apr 2006 13:28:50 +0000 (13:28 +0000)
Message-Id: <200604131239.k3DCdXhe124107@kosh.hut.fi>
Date: Thu, 13 Apr 2006 15:39:33 +0300 (EEST)

p4raw-id: //depot/perl@27788

regexec.c

index 459002a..399410f 100644 (file)
--- a/regexec.c
+++ b/regexec.c
@@ -1605,10 +1605,10 @@ Perl_regexec_flags(pTHX_ register regexp *prog, char *stringarg, register char *
     char *scream_olds = NULL;
     SV* oreplsv = GvSV(PL_replgv);
     const bool do_utf8 = DO_UTF8(sv);
     char *scream_olds = NULL;
     SV* oreplsv = GvSV(PL_replgv);
     const bool do_utf8 = DO_UTF8(sv);
-    const I32 multiline = prog->reganch & PMf_MULTILINE;
+    I32 multiline;
 #ifdef DEBUGGING
 #ifdef DEBUGGING
-    SV * const dsv0 = PERL_DEBUG_PAD_ZERO(0);
-    SV * const dsv1 = PERL_DEBUG_PAD_ZERO(1);
+    SV* dsv0;
+    SV* dsv1;
 #endif
 
     GET_RE_DEBUG_FLAGS_DECL;
 #endif
 
     GET_RE_DEBUG_FLAGS_DECL;
@@ -1621,6 +1621,13 @@ Perl_regexec_flags(pTHX_ register regexp *prog, char *stringarg, register char *
        return 0;
     }
 
        return 0;
     }
 
+    multiline = prog->reganch & PMf_MULTILINE;
+
+#ifdef DEBUGGING
+    dsv0 = PERL_DEBUG_PAD_ZERO(0);
+    dsv1 = PERL_DEBUG_PAD_ZERO(1);
+#endif
+
 #ifdef DEBUGGING
     PL_regnarrate = DEBUG_r_TEST;
 #endif
 #ifdef DEBUGGING
     PL_regnarrate = DEBUG_r_TEST;
 #endif