allow abort in libfuzzer

This commit is contained in:
Alex Groce
2018-12-02 20:34:19 -07:00
parent 87dd39d93c
commit 8b912a8ce1
+7
View File
@@ -601,6 +601,13 @@ extern int LLVMFuzzerTestOneInput(const uint8_t *Data, size_t Size) {
enum DeepState_TestRunResult result = DeepState_RunTestLLVM(test);
const char* abort_check = getenv("LIBFUZZER_ABORT_ON_FAIL");
if (abort_check != NULL) {
if ((result == DeepState_TestRunFail) || (result == DeepState_TestRunCrash)) {
abort();
}
}
DeepState_Teardown();
DeepState_CurrentTestRun = NULL;
free(mem);