From 5b6be8ee92f615137555abea6248b4e39f12862a Mon Sep 17 00:00:00 2001 From: Karl Williamson Date: Wed, 10 Feb 2016 11:28:58 -0700 Subject: [PATCH 1/1] regcomp.c: Replace invalid assertion A future commit shows that this assertion is not valid. I don't know how it can currently be triggered, but fix the code to properly handle the case. --- regcomp.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/regcomp.c b/regcomp.c index cc80e1b..66cffd4 100644 --- a/regcomp.c +++ b/regcomp.c @@ -8629,7 +8629,10 @@ Perl__invlist_search(SV* const invlist, const UV cp) array = invlist_array(invlist); mid = invlist_previous_index(invlist); - assert(mid >=0 && mid <= highest_element); + assert(mid >=0); + if (mid > highest_element) { + mid = highest_element; + } /* contains the cache of the result of the previous call to this * function (0 the first time). See if this call is for the same result, -- 1.8.3.1