[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.

llvm-svn: 359126
This commit is contained in:
Adhemerval Zanella 2019-04-24 19:02:54 +00:00
parent 97bdb04a3b
commit 91cee68e1f
1 changed files with 2 additions and 2 deletions

View File

@ -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 LLVMFuzzerCustomMutator(uint8_t *Data, size_t Size,
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;
}