diff options
author | Andrew Reynolds <andrew.j.reynolds@gmail.com> | 2018-06-12 15:22:15 -0500 |
---|---|---|
committer | Andres Noetzli <andres.noetzli@gmail.com> | 2018-06-12 13:22:15 -0700 |
commit | b0a4253162ae4735f15540b41794f05f4f7f26f8 (patch) | |
tree | ee5b06f4a3ae2efa8dbbddb7e77237a65292dd18 /src | |
parent | b19c840d2bd756d272b8b44c122be809a8b1c633 (diff) |
Fix strip constant endpoint for ITOS in strings rewriter (#2067)
Diffstat (limited to 'src')
-rw-r--r-- | src/theory/strings/theory_strings_rewriter.cpp | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/src/theory/strings/theory_strings_rewriter.cpp b/src/theory/strings/theory_strings_rewriter.cpp index a426c0306..78def9c0a 100644 --- a/src/theory/strings/theory_strings_rewriter.cpp +++ b/src/theory/strings/theory_strings_rewriter.cpp @@ -2915,9 +2915,10 @@ bool TheoryStringsRewriter::stripConstantEndpoints(std::vector<Node>& n1, { const std::vector<unsigned>& svec = s.getVec(); // can remove up to the first occurrence of a digit - for (unsigned i = 0; i < svec.size(); i++) + unsigned svsize = svec.size(); + for (unsigned i = 0; i < svsize; i++) { - unsigned sindex = r == 0 ? i : svec.size() - i; + unsigned sindex = r == 0 ? i : (svsize - 1) - i; if (String::isDigit(svec[sindex])) { break; |