summaryrefslogtreecommitdiff
path: root/regcomp.c
diff options
context:
space:
mode:
authorKarl Williamson <khw@cpan.org>2014-04-28 21:10:48 -0600
committerKarl Williamson <khw@cpan.org>2014-05-30 15:58:40 -0600
commita283d99919666e4dba96ead467c038ed9179bf4f (patch)
tree1918399513e9c6b35c3556f1165048214429ff86 /regcomp.c
parentdd2bfca9b7c4d502702489a8b15f14e9582e325a (diff)
downloadperl-a283d99919666e4dba96ead467c038ed9179bf4f.tar.gz
regcomp.c: Add assertion
This is because coverity thinks this could happen, and jhi and khw don't
Diffstat (limited to 'regcomp.c')
-rw-r--r--regcomp.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/regcomp.c b/regcomp.c
index 233fd88681..557b517ba6 100644
--- a/regcomp.c
+++ b/regcomp.c
@@ -13789,6 +13789,11 @@ parseit:
ANYOF_POSIXL_ZERO(ret);
}
+ /* Coverity thinks it is possible for this to be negative; both
+ * jhi and khw think it's not, but be safer */
+ assert(! (ANYOF_FLAGS(ret) & ANYOF_POSIXL)
+ || (namedclass + ((namedclass % 2) ? -1 : 1)) >= 0);
+
/* See if it already matches the complement of this POSIX
* class */
if ((ANYOF_FLAGS(ret) & ANYOF_POSIXL)