From 5b09e95f63e19940993b3301f1f7ceee62e2b2d5 Mon Sep 17 00:00:00 2001 From: Andres Noetzli Date: Tue, 21 Jan 2020 23:36:47 -0800 Subject: Fix edge case --- src/theory/strings/regexp_elim.cpp | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/src/theory/strings/regexp_elim.cpp b/src/theory/strings/regexp_elim.cpp index c8ca000e9..986ab7d66 100644 --- a/src/theory/strings/regexp_elim.cpp +++ b/src/theory/strings/regexp_elim.cpp @@ -383,7 +383,7 @@ Node RegExpElimination::eliminateConcat(Node atom) if (r == 0) { rexpElimChildrenStart = index; - if (index == rexpElimChildrenEnd) { + if (index == nchildren) { break; } } @@ -395,8 +395,9 @@ Node RegExpElimination::eliminateConcat(Node atom) if (!sConstraints.empty()) { - std::vector rexpElimChildren(children.begin() + rexpElimChildrenStart, - children.begin() + rexpElimChildrenEnd); + std::vector rexpElimChildren( + children.begin() + rexpElimChildrenStart, + children.begin() + rexpElimChildrenEnd + 1); if (!rexpElimChildren.empty()) { Node ss = nm->mkNode(STRING_SUBSTR, x, sStartIndex, sLength); -- cgit v1.2.3