about summary refs log tree commit diff homepage
diff options
context:
space:
mode:
-rw-r--r--include/klee/Expr.h4
-rw-r--r--include/klee/util/Ref.h4
-rw-r--r--lib/Expr/Expr.cpp3
3 files changed, 3 insertions, 8 deletions
diff --git a/include/klee/Expr.h b/include/klee/Expr.h
index cb5423e0..f0adc42d 100644
--- a/include/klee/Expr.h
+++ b/include/klee/Expr.h
@@ -178,10 +178,6 @@ public:
   /// Returns the hash value. 
   virtual unsigned computeHash();
   
-  static unsigned hashConstant(uint64_t val, Width w) {
-    return val ^ (w * MAGIC_HASH_CONSTANT);
-  }
-  
   /// Returns 0 iff b is structuraly equivalent to *this
   int compare(const Expr &b) const;
   virtual int compareContents(const Expr &b) const { return 0; }
diff --git a/include/klee/util/Ref.h b/include/klee/util/Ref.h
index f900f137..a552df39 100644
--- a/include/klee/util/Ref.h
+++ b/include/klee/util/Ref.h
@@ -129,7 +129,7 @@ public:
 
   unsigned hash() const {
     if (constantWidth) {
-      return Expr::hashConstant(contents.val, constantWidth);
+      return contents.val ^ (constantWidth * Expr::MAGIC_HASH_CONSTANT);
     } else {
       return contents.ptr->hash();
     }
@@ -137,7 +137,7 @@ public:
 
   unsigned computeHash() const {
     if (isConstant()) {
-      return Expr::hashConstant(contents.val, constantWidth);
+      return contents.val ^ (constantWidth * Expr::MAGIC_HASH_CONSTANT);
     } else {
       return contents.ptr->computeHash();
     }
diff --git a/lib/Expr/Expr.cpp b/lib/Expr/Expr.cpp
index 7f20e3fc..9def85d7 100644
--- a/lib/Expr/Expr.cpp
+++ b/lib/Expr/Expr.cpp
@@ -165,8 +165,7 @@ unsigned Expr::computeHash() {
 }
 
 unsigned ConstantExpr::computeHash() {
-  hashValue = Expr::hashConstant(asUInt64, width);
-  return hashValue;
+  return asUInt64 ^ (width * MAGIC_HASH_CONSTANT);
 }
 
 unsigned CastExpr::computeHash() {