Explorar o código

Fix nightly run sanitizer error in Fast JIT (#2601)

Suppress a sanitizer integer overflow error in signed integer add operation
in Fast JIT.
Wenyong Huang %!s(int64=2) %!d(string=hai) anos
pai
achega
fff0e2ad1c
Modificáronse 1 ficheiros con 8 adicións e 0 borrados
  1. 8 0
      core/iwasm/fast-jit/fe/jit_emit_numberic.c

+ 8 - 0
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;                                                     \