develooper Front page | perl.perl5.porters | Postings from April 2006

[PATCH] regexec.c: move NULL check earlier to make Coverity happier

Thread Next
From:
Jarkko Hietaniemi
Date:
April 11, 2006 13:05
Subject:
[PATCH] regexec.c: move NULL check earlier to make Coverity happier
Message ID:
200604112004.k3BK4mV3097400@kosh.hut.fi
--- regexec.c.dist	2006-04-11 22:55:16.000000000 +0300
+++ regexec.c	2006-04-11 23:03:37.000000000 +0300
@@ -1615,12 +1615,6 @@
     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 @@
 	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,

Thread Next


nntp.perl.org: Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at ask@perl.org | Group listing | About