[klee-dev] [PATCH 3/3] Fix NotExpr::computeHash() shadowing hashValue

Jonathan Neuschäfer j.neuschaefer at gmx.net
Mon Jul 1 22:25:35 BST 2013


Without this patch NotExpr::computeHash() will have a local
valiable with the name "hashValue" and assign the newly computed
hash to that instead of the member variable with the same name
that should be set by the computeHash method of every Expr subclass.
---
 lib/Expr/Expr.cpp | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/lib/Expr/Expr.cpp b/lib/Expr/Expr.cpp
index d177eca..1187573 100644
--- a/lib/Expr/Expr.cpp
+++ b/lib/Expr/Expr.cpp
@@ -206,7 +206,7 @@ unsigned ReadExpr::computeHash() {
 }
 
 unsigned NotExpr::computeHash() {
-  unsigned hashValue = expr->hash() * Expr::MAGIC_HASH_CONSTANT * Expr::Not;
+  hashValue = expr->hash() * Expr::MAGIC_HASH_CONSTANT * Expr::Not;
   return hashValue;
 }
 
-- 
1.8.3.1





More information about the klee-dev mailing list