-
-
Notifications
You must be signed in to change notification settings - Fork 271
Open
Labels
Description
Should we set -disable-fp-elim as soon as any sanitizer is set? (-fsanitize=...)
This example requires -disable-fp-elim, otherwise LLVMFuzzerTestOneInput is missing from the stacktrace (only FuzzMe is shown).
// RUN: %ldc -g -fsanitize=address,fuzzer -disable-fp-elim %s -of=%t%exe
// RUN: %t%exe 2>&1 | FileCheck %s
bool FuzzMe(ubyte* data, size_t dataSize)
{
return dataSize >= 4 &&
data[0] == 'F' &&
data[1] == 'U' &&
data[2] == 'Z' &&
data[3] == 'Z' &&
data[4] == 'Z'; // :‑<
}
extern (C) int LLVMFuzzerTestOneInput(const(ubyte*) data, size_t size)
{
FuzzMe(data, size);
return 0;
}See the sanitizers/fuzz_asan.d test in our testsuite.