From 7ef508afbc4651362f05e0989f7a1700f50a5f22 Mon Sep 17 00:00:00 2001 From: Daniel Dunbar Date: Tue, 9 Jun 2009 07:42:33 +0000 Subject: 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 --- lib/Expr/ExprEvaluator.cpp | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'lib/Expr/ExprEvaluator.cpp') 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)); } -- cgit 1.4.1