From fff0e2ad1cf9d5749f0e92582167353af995f730 Mon Sep 17 00:00:00 2001 From: Wenyong Huang Date: Wed, 27 Sep 2023 15:41:48 +0800 Subject: [PATCH] Fix nightly run sanitizer error in Fast JIT (#2601) Suppress a sanitizer integer overflow error in signed integer add operation in Fast JIT. --- core/iwasm/fast-jit/fe/jit_emit_numberic.c | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/core/iwasm/fast-jit/fe/jit_emit_numberic.c b/core/iwasm/fast-jit/fe/jit_emit_numberic.c index 03491e691..6a1e93ede 100644 --- a/core/iwasm/fast-jit/fe/jit_emit_numberic.c +++ b/core/iwasm/fast-jit/fe/jit_emit_numberic.c @@ -298,7 +298,15 @@ fail: /* macros for integer binary operations (ibinop) */ +#if defined(__GNUC__) +#define NO_SANITIZER_INTEGER \ + __attribute__((no_sanitize("signed-integer-overflow"))) +#else +#define NO_SANITIZER_INTEGER +#endif + #define __DEF_BI_INT_CONST_OPS(bits, opname, op) \ + NO_SANITIZER_INTEGER \ static int##bits do_i##bits##_const_##opname(int##bits lhs, int##bits rhs) \ { \ return lhs op rhs; \