tests/fuzzer: fix eglInitialize() leak suppression

__lsan_default_suppressions is only defined if -fsanitize=address, but
leak suppression is still needed when the LeakSanitizer is used without
the AddressSanitizer (-fsanitize=fuzzer for example, since LeakSanitizer
is enabled by default on linux).

Signed-off-by: Ryan Neph <ryanneph@google.com>
Reviewed-by: Chia-I Wu <olvaffe@gmail.com>
Reviewed-by: David Riley davidriley@chromium.org
macos/master
Ryan Neph 3 years ago committed by Chia-I Wu
parent 148e6c3d0d
commit 9e714ff394
  1. 8
      tests/fuzzer/virgl_fuzzer.c

@ -44,18 +44,10 @@ int LLVMFuzzerTestOneInput(const uint8_t* data, size_t size);
// eglInitialize leaks unless eglTeriminate is called (which only happens // eglInitialize leaks unless eglTeriminate is called (which only happens
// with CLEANUP_EACH_INPUT), so suppress leak detection on everything // with CLEANUP_EACH_INPUT), so suppress leak detection on everything
// allocated by it. // allocated by it.
#if !defined(__has_feature)
#define __has_feature(x) 0
#endif
#if __has_feature(address_sanitizer)
const char* __lsan_default_suppressions(void); const char* __lsan_default_suppressions(void);
const char* __lsan_default_suppressions() { const char* __lsan_default_suppressions() {
return "leak:eglInitialize\n"; return "leak:eglInitialize\n";
} }
#endif // __has_feature(address_sanitizer)
#endif // !CLEANUP_EACH_INPUT #endif // !CLEANUP_EACH_INPUT

Loading…
Cancel
Save