]> www.ginac.de Git - ginac.git/blobdiff - ginac/symbol.cpp
calchash(): work around broken RTTI.
[ginac.git] / ginac / symbol.cpp
index cb33de7f964342699e2cc017bbdfbc181c5a2c76..a736088903872dd854dfe55c34020a08a6aed1ea 100644 (file)
@@ -25,6 +25,7 @@
 #include "archive.h"
 #include "tostring.h"
 #include "utils.h"
+#include "hash_seed.h"
 #include "inifcns.h"
 
 #include <map>
@@ -253,8 +254,8 @@ bool symbol::is_equal_same_type(const basic & other) const
 
 unsigned symbol::calchash() const
 {
-       const void* this_tinfo = (const void*)typeid(*this).name();
-       hashvalue = golden_ratio_hash((p_int)this_tinfo ^ serial);
+       unsigned seed = make_hash_seed(typeid(*this));
+       hashvalue = golden_ratio_hash(seed ^ serial);
        setflag(status_flags::hash_calculated);
        return hashvalue;
 }