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

[PATCH] regcomp.c: possible way to convince Coverity that listsv is always non-NULL

Thread Next
From:
Jarkko Hietaniemi
Date:
April 11, 2006 12:51
Subject:
[PATCH] regcomp.c: possible way to convince Coverity that listsv is always non-NULL
Message ID:
200604111951.k3BJp1bE229245@kosh.hut.fi
--- regcomp.c.dist	2006-04-11 22:28:55.000000000 +0300
+++ regcomp.c	2006-04-11 22:47:39.000000000 +0300
@@ -4675,9 +4675,10 @@
 	if (LOC)
 	    ANYOF_FLAGS(ret) |= ANYOF_LOCALE;
 	ANYOF_BITMAP_ZERO(ret);
-	listsv = newSVpvs("# comment\n");
     }
 
+    listsv = newSVpvs("# comment\n");
+
     nextvalue = RExC_parse < RExC_end ? UCHARAT(RExC_parse) : 0;
 
     if (!SIZE_ONLY && POSIXCC(nextvalue))
@@ -5404,6 +5405,9 @@
 	ARG_SET(ret, n);
     }
 
+    if (SIZE_ONLY)
+	SvREFCNT_dec(listsv);
+
     return ret;
 }
 

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