[libFuzzer] Fix fuzzer-oom.test.

SinkPtr was not correctly marked as volatile, causing the malloc to get
optimized out.  This was causing 20-minute timeouts for the test and no
OOM.
This commit is contained in:
Matt Morehouse 2021-04-13 11:12:05 -07:00
parent 9b8e7a9d7d
commit b351590bae
2 changed files with 2 additions and 2 deletions

View File

@ -10,7 +10,7 @@
#include <cstring>
#include <iostream>
static volatile char *SinkPtr;
static char *volatile SinkPtr;
extern "C" int LLVMFuzzerTestOneInput(const uint8_t *Data, size_t Size) {
if (Size > 0 && Data[0] == 'H') {

View File

@ -11,7 +11,7 @@
#include <iostream>
#include <thread>
static volatile char *SinkPtr;
static char *volatile SinkPtr;
extern "C" int LLVMFuzzerTestOneInput(const uint8_t *Data, size_t Size) {
if (Size > 0 && Data[0] == 'H') {