about summary refs log tree commit diff homepage
path: root/lib/Expr/Expr.cpp
diff options
context:
space:
mode:
authorMartinNowack <martin.nowack@gmail.com>2016-02-27 10:51:26 +0100
committerMartinNowack <martin.nowack@gmail.com>2016-02-27 10:51:26 +0100
commit0fc86ca9e28cc411cb5e00afa22c32e77aca7e57 (patch)
tree9b5f194182f919a79cb3f10758d31da1080c18e2 /lib/Expr/Expr.cpp
parentd5df88965392327d1f32890c1a8be4be164248fd (diff)
parent9bc1d11162403e331e99d5d0494feab70ace6fbc (diff)
downloadklee-0fc86ca9e28cc411cb5e00afa22c32e77aca7e57.tar.gz
Merge pull request #342 from delcypher/expr_fixes
A few Expr related clean ups
Diffstat (limited to 'lib/Expr/Expr.cpp')
-rw-r--r--lib/Expr/Expr.cpp18
1 files changed, 17 insertions, 1 deletions
diff --git a/lib/Expr/Expr.cpp b/lib/Expr/Expr.cpp
index 2c64aff4..182093b9 100644
--- a/lib/Expr/Expr.cpp
+++ b/lib/Expr/Expr.cpp
@@ -481,7 +481,23 @@ ref<Expr>  NotOptimizedExpr::create(ref<Expr> src) {
 
 /***/
 
-extern "C" void vc_DeleteExpr(void*);
+Array::Array(const std::string &_name, uint64_t _size,
+             const ref<ConstantExpr> *constantValuesBegin,
+             const ref<ConstantExpr> *constantValuesEnd, Expr::Width _domain,
+             Expr::Width _range)
+    : name(_name), size(_size), domain(_domain), range(_range),
+      constantValues(constantValuesBegin, constantValuesEnd) {
+
+  assert((isSymbolicArray() || constantValues.size() == size) &&
+         "Invalid size for constant array!");
+  computeHash();
+#ifndef NDEBUG
+  for (const ref<ConstantExpr> *it = constantValuesBegin;
+       it != constantValuesEnd; ++it)
+    assert((*it)->getWidth() == getRange() &&
+           "Invalid initial constant value!");
+#endif // NDEBUG
+}
 
 Array::~Array() {
 }