about summary refs log tree commit diff homepage
path: root/lib/Expr/ArrayExprRewriter.cpp
diff options
context:
space:
mode:
authorJulian Büning <julian.buening@rwth-aachen.de>2020-10-10 15:13:06 +0200
committerCristian Cadar <c.cadar@imperial.ac.uk>2020-11-12 10:13:54 +0000
commitc763a4087f1d8fa4dbdfb9c8f30d545cdb66a0aa (patch)
tree5d40c27ecfb16230aa3e714a3e7690b44b322860 /lib/Expr/ArrayExprRewriter.cpp
parentacdb9a692d9eee8dd102befa4e101bfa5f028b0e (diff)
downloadklee-c763a4087f1d8fa4dbdfb9c8f30d545cdb66a0aa.tar.gz
Ref: implement operator bool()
Diffstat (limited to 'lib/Expr/ArrayExprRewriter.cpp')
-rw-r--r--lib/Expr/ArrayExprRewriter.cpp3
1 files changed, 1 insertions, 2 deletions
diff --git a/lib/Expr/ArrayExprRewriter.cpp b/lib/Expr/ArrayExprRewriter.cpp
index 4de76d43..2732cdc4 100644
--- a/lib/Expr/ArrayExprRewriter.cpp
+++ b/lib/Expr/ArrayExprRewriter.cpp
@@ -44,12 +44,11 @@ ref<Expr> ExprRewriter::rewrite(const ref<Expr> &e, const array2idx_ty &arrays,
            "Read is not aligned");
 
     Expr::Width width = idxt_v.getWidth() / element.first->range;
-    if (!idxt_v.getMul().isNull()) {
+    if (auto e = idxt_v.getMul()) {
       // If we have a MulExpr in the index, we can optimize our search by
       // skipping all those indexes that are not multiple of such value.
       // In fact, they will be rejected by the MulExpr interpreter since it
       // will not find any integer solution
-      auto e = idxt_v.getMul();
       auto ce = dyn_cast<ConstantExpr>(e);
       assert(ce && "Not a constant expression");