Chandler Carruth | 2946cd7 | 2019-01-19 08:50:56 +0000 | [diff] [blame^] | 1 | // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. |
| 2 | // See https://llvm.org/LICENSE.txt for license information. |
| 3 | // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception |
Matt Morehouse | 52fd169 | 2018-05-01 21:01:53 +0000 | [diff] [blame] | 4 | |
| 5 | // Ensures that error reports are suppressed after |
| 6 | // __sanitizer_acquire_crash_state() has been called the first time. |
| 7 | #include "sanitizer/common_interface_defs.h" |
| 8 | |
| 9 | #include <cassert> |
| 10 | #include <cstdint> |
| 11 | #include <cstdlib> |
| 12 | |
| 13 | extern "C" int LLVMFuzzerTestOneInput(const uint8_t *Data, size_t Size) { |
| 14 | assert(Data); |
| 15 | if (Size == 0) return 0; |
| 16 | __sanitizer_acquire_crash_state(); |
| 17 | exit(0); // No report should be generated here. |
| 18 | } |
| 19 | |