about summary refs log tree commit diff homepage
path: root/lib/Expr/ExprEvaluator.cpp
diff options
context:
space:
mode:
authorDaniel Dunbar <daniel@zuster.org>2009-06-09 07:42:33 +0000
committerDaniel Dunbar <daniel@zuster.org>2009-06-09 07:42:33 +0000
commit7ef508afbc4651362f05e0989f7a1700f50a5f22 (patch)
tree08fed19e61a85ce0d3651cf26bc3f32f2b789490 /lib/Expr/ExprEvaluator.cpp
parent78b1df8bd1664931fe32d186a21a7ebf58ad9489 (diff)
downloadklee-7ef508afbc4651362f05e0989f7a1700f50a5f22.tar.gz
Add initial support for constant Arrays.
 - This doesn't actually start using them, it just attempts to update all
   clients to do the right thing in the presence of them.


git-svn-id: https://llvm.org/svn/llvm-project/klee/trunk@73130 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Expr/ExprEvaluator.cpp')
-rw-r--r--lib/Expr/ExprEvaluator.cpp6
1 files changed, 5 insertions, 1 deletions
diff --git a/lib/Expr/ExprEvaluator.cpp b/lib/Expr/ExprEvaluator.cpp
index bf229731..41cb7c48 100644
--- a/lib/Expr/ExprEvaluator.cpp
+++ b/lib/Expr/ExprEvaluator.cpp
@@ -25,10 +25,14 @@ ExprVisitor::Action ExprEvaluator::evalRead(const UpdateList &ul,
       // version though (mostly for debugging).
       
       return Action::changeTo(ReadExpr::create(UpdateList(ul.root, un), 
-                                               ConstantExpr::alloc(index, Expr::Int32)));
+                                               ConstantExpr::alloc(index, 
+                                                                   ul.root->getDomain())));
     }
   }
   
+  if (ul.root->isConstantArray() && index < ul.root->size)
+    return Action::changeTo(ul.root->constantValues[index]);
+
   return Action::changeTo(getInitialValue(*ul.root, index));
 }