[compiler-rt] r359126 - [fuzzer] Fix reload.test on Linux/aarch64
Adhemerval Zanella via llvm-commits
llvm-commits at lists.llvm.org
Wed Apr 24 12:02:54 PDT 2019
Author: azanella
Date: Wed Apr 24 12:02:54 2019
New Revision: 359126
URL: http://llvm.org/viewvc/llvm-project?rev=359126&view=rev
Log:
[fuzzer] Fix reload.test on Linux/aarch64
The compiler generates a 'brk' instruction for __builtin_trap on aarch64
and Linux kernel issues a SIGTRAP. It is different from x86, where
compiler emits an 'ud2' and kernel issues a SIGILL.
A straightforward is to use abort instead.
Modified:
compiler-rt/trunk/test/fuzzer/ReloadTest.cpp
Modified: compiler-rt/trunk/test/fuzzer/ReloadTest.cpp
URL: http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/test/fuzzer/ReloadTest.cpp?rev=359126&r1=359125&r2=359126&view=diff
==============================================================================
--- compiler-rt/trunk/test/fuzzer/ReloadTest.cpp (original)
+++ compiler-rt/trunk/test/fuzzer/ReloadTest.cpp Wed Apr 24 12:02:54 2019
@@ -5,9 +5,9 @@
// Test that fuzzer we can reload artifacts with any bytes inside.
#include <algorithm>
#include <cstdint>
+#include <cstdlib>
#include <numeric>
#include <set>
-#include <stdio.h>
extern "C" size_t LLVMFuzzerCustomMutator(uint8_t *Data, size_t Size,
size_t MaxSize, unsigned int Seed) {
@@ -19,6 +19,6 @@ extern "C" size_t LLVMFuzzerCustomMutato
extern "C" int LLVMFuzzerTestOneInput(const uint8_t *Data, size_t Size) {
if (Size > 5000 && std::set<uint8_t>(Data, Data + Size).size() > 255 &&
(uint8_t)std::accumulate(Data, Data + Size, uint8_t(Size)) == 0)
- __builtin_trap();
+ abort();
return 0;
}
More information about the llvm-commits
mailing list