poke-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[PATCH] Fix implicit-signed-integer-truncation in hash function


From: Tim Rühsen
Subject: [PATCH] Fix implicit-signed-integer-truncation in hash function
Date: Sun, 17 May 2020 20:08:27 +0200

The ASAN report was:
pkl-env.c:74:12: runtime error: implicit conversion from type 'unsigned long'
of value 591105371825 (64-bit, unsigned) to type 'int' changed the value to
-1600115023 (32-bit, signed)

2020-05-17  Tim Rühsen  <address@hidden>

        * libpoke/pkl-env.c (hash_string): Suppress ASAN runtime error
        "implicit-signed-integer-truncation-or-sign-change".
---
 ChangeLog         | 5 +++++
 libpoke/pkl-env.c | 4 +++-
 2 files changed, 8 insertions(+), 1 deletion(-)

diff --git a/libpoke/pkl-env.c b/libpoke/pkl-env.c
index e1a74d42..636d0a84 100644
--- a/libpoke/pkl-env.c
+++ b/libpoke/pkl-env.c
@@ -60,7 +60,9 @@ struct pkl_env

 /* The hash tables above are handled using the following
    functions.  */
-
+#ifdef __clang__
+__attribute__((no_sanitize("integer")))
+#endif
 static int
 hash_string (const char *name)
 {
--
2.26.2




reply via email to

[Prev in Thread] Current Thread [Next in Thread]