Kostya Serebryany | 4b17a33 | 2016-09-09 21:58:42 +0000 | [diff] [blame] | 1 | // This file is distributed under the University of Illinois Open Source |
| 2 | // License. See LICENSE.TXT for details. |
| 3 | |
| 4 | // abs(x) < 0 and y == Const puzzle, 64-bit variant. |
Kostya Serebryany | 4b17a33 | 2016-09-09 21:58:42 +0000 | [diff] [blame] | 5 | #include <cstddef> |
Chandler Carruth | 6bda14b | 2017-06-06 11:49:48 +0000 | [diff] [blame] | 6 | #include <cstdint> |
Kostya Serebryany | 4b17a33 | 2016-09-09 21:58:42 +0000 | [diff] [blame] | 7 | #include <cstdio> |
Chandler Carruth | 6bda14b | 2017-06-06 11:49:48 +0000 | [diff] [blame] | 8 | #include <cstdlib> |
| 9 | #include <cstring> |
Kostya Serebryany | 4b17a33 | 2016-09-09 21:58:42 +0000 | [diff] [blame] | 10 | |
| 11 | extern "C" int LLVMFuzzerTestOneInput(const uint8_t *Data, size_t Size) { |
| 12 | if (Size < 16) return 0; |
Kostya Serebryany | 1837152 | 2016-09-09 22:21:16 +0000 | [diff] [blame] | 13 | int64_t x; |
| 14 | uint64_t y; |
| 15 | memcpy(&x, Data, sizeof(x)); |
| 16 | memcpy(&y, Data + sizeof(x), sizeof(y)); |
Marcos Pividori | 5a53567 | 2017-02-08 00:03:31 +0000 | [diff] [blame] | 17 | if (llabs(x) < 0 && y == 0xbaddcafedeadbeefULL) { |
Kostya Serebryany | 4b17a33 | 2016-09-09 21:58:42 +0000 | [diff] [blame] | 18 | printf("BINGO; Found the target, exiting; x = 0x%lx y 0x%lx\n", x, y); |
| 19 | exit(1); |
| 20 | } |
| 21 | return 0; |
| 22 | } |
| 23 | |