Răsfoiți Sursa

Suppress UBSAN warning

Jorrit Rouwe 3 ani în urmă
părinte
comite
c830f38680
1 a modificat fișierele cu 3 adăugiri și 0 ștergeri
  1. 3 0
      Jolt/Core/HashCombine.h

+ 3 - 0
Jolt/Core/HashCombine.h

@@ -25,6 +25,9 @@ inline uint64 HashBytes(const void *inData, uint inSize, uint64 inSeed = 0xcbf29
 /// @brief Helper function that hashes a single value into ioSeed
 /// Taken from: https://stackoverflow.com/questions/2590677/how-do-i-combine-hash-values-in-c0x
 template <typename T>
+#ifdef JPH_COMPILER_CLANG
+	__attribute__((no_sanitize("unsigned-integer-overflow"))) // We intentionally overflow during hashing
+#endif
 inline void HashCombineHelper(size_t &ioSeed, const T &inValue)
 {
 	std::hash<T> hasher;