From 60825692bcf7fad90295e59710cb01eaf0d301a2 Mon Sep 17 00:00:00 2001 From: Karl Williamson Date: Sun, 27 Nov 2011 20:49:59 -0700 Subject: [PATCH] regcomp.c: Add some assertions Subsequent code assumes that these are true --- regcomp.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/regcomp.c b/regcomp.c index fac23f5..96bb92a 100644 --- a/regcomp.c +++ b/regcomp.c @@ -6308,6 +6308,7 @@ Perl__invlist_union(pTHX_ SV* const a, SV* const b, SV** output) UV count = 0; PERL_ARGS_ASSERT__INVLIST_UNION; + assert(a != b); /* If either one is empty, the union is the other one */ len_a = invlist_len(a); @@ -6494,6 +6495,7 @@ Perl__invlist_intersection(pTHX_ SV* const a, SV* const b, SV** i) UV count = 0; PERL_ARGS_ASSERT__INVLIST_INTERSECTION; + assert(a != b); /* If either one is empty, the intersection is null */ len_a = invlist_len(a); @@ -6772,6 +6774,7 @@ Perl__invlist_subtract(pTHX_ SV* const a, SV* const b, SV** result) * that aren't also in */ PERL_ARGS_ASSERT__INVLIST_SUBTRACT; + assert(a != b); /* Subtracting nothing retains the original */ if (invlist_len(b) == 0) { -- 2.7.4