Skip to content

Commit d70b794

Browse files
committed
fix(mem): the MSan guard in the spill store goes through sanitized.h
cppcheck cannot evaluate `#if __has_feature(memory_sanitizer)` even behind `#if defined(__has_feature)` ("undefined function-like macro invocation", the lint lane on d89ccab), and foundation/sanitized.h already exists for exactly that: it defines __has_feature away where the preprocessor lacks it. The spill store's image annotation now includes that header and tests the feature directly; the annotation itself is unchanged. Signed-off-by: Martin Vogel <martin.vogel.tech@gmail.com>
1 parent d89ccab commit d70b794

1 file changed

Lines changed: 2 additions & 4 deletions

File tree

‎internal/cbm/result_spill.c‎

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -29,13 +29,11 @@
2929
* lane on #2202: offset 4087, then 6714, of a 6,952-byte block). Under MSan
3030
* the image is declared defined right before the write; every other build
3131
* compiles this to nothing. */
32-
#if defined(__has_feature)
32+
#include "foundation/sanitized.h" /* __has_feature exists everywhere, cppcheck included */
3333
#if __has_feature(memory_sanitizer)
3434
#include <sanitizer/msan_interface.h>
3535
#define SPILL_IMAGE_DEFINED(p, n) __msan_unpoison((p), (n))
36-
#endif
37-
#endif
38-
#ifndef SPILL_IMAGE_DEFINED
36+
#else
3937
#define SPILL_IMAGE_DEFINED(p, n) ((void)0)
4038
#endif
4139

0 commit comments

Comments
 (0)