This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
regexec.c: move NULL check earlier to make Coverity happier
authorJarkko Hietaniemi <jhi@iki.fi>
Tue, 11 Apr 2006 23:04:48 +0000 (02:04 +0300)
committerNicholas Clark <nick@ccl4.org>
Tue, 11 Apr 2006 22:17:25 +0000 (22:17 +0000)
Message-Id: <200604112004.k3BK4mV3097400@kosh.hut.fi>
Date: Tue, 11 Apr 2006 23:04:48 +0300 (EEST)

p4raw-id: //depot/perl@27772

regexec.c

index 2f4d8a7..61a0115 100644 (file)
--- a/regexec.c
+++ b/regexec.c
@@ -1615,12 +1615,6 @@ Perl_regexec_flags(pTHX_ register regexp *prog, char *stringarg, register char *
     GET_RE_DEBUG_FLAGS_DECL;
 
     PERL_UNUSED_ARG(data);
-    RX_MATCH_UTF8_set(prog,do_utf8);
-
-    PL_reg_re = prog;
-#ifdef DEBUGGING
-    PL_regnarrate = DEBUG_r_TEST;
-#endif
 
     /* Be paranoid... */
     if (prog == NULL || startpos == NULL) {
@@ -1628,6 +1622,13 @@ Perl_regexec_flags(pTHX_ register regexp *prog, char *stringarg, register char *
        return 0;
     }
 
+    PL_reg_re = prog;
+#ifdef DEBUGGING
+    PL_regnarrate = DEBUG_r_TEST;
+#endif
+
+    RX_MATCH_UTF8_set(prog, do_utf8);
+
     minlen = prog->minlen;
     if (strend - startpos < minlen) {
         DEBUG_EXECUTE_r(PerlIO_printf(Perl_debug_log,