Fix the mac OS abort problem with libFuzzer
This commit is contained in:
@@ -724,7 +724,7 @@ static int DeepState_RunSingleSavedTestCase(void) {
|
||||
|
||||
if ((result == DeepState_TestRunFail) || (result == DeepState_TestRunCrash)) {
|
||||
if (FLAGS_abort_on_fail) {
|
||||
abort();
|
||||
assert(0); // Terminate in a way AFL/etc. can see as a crash
|
||||
}
|
||||
num_failed_tests++;
|
||||
}
|
||||
@@ -790,7 +790,7 @@ static int DeepState_RunSingleSavedTestDir(void) {
|
||||
|
||||
if ((result == DeepState_TestRunFail) || (result == DeepState_TestRunCrash)) {
|
||||
if (FLAGS_abort_on_fail) {
|
||||
abort();
|
||||
assert(0); // Terminate in a way AFL/etc. can see as a crash
|
||||
}
|
||||
|
||||
num_failed_tests++;
|
||||
|
||||
+2
-2
@@ -741,7 +741,7 @@ enum DeepState_TestRunResult DeepState_FuzzOneTestCase(struct DeepState_TestInfo
|
||||
|
||||
if (FLAGS_abort_on_fail && ((result == DeepState_TestRunCrash) ||
|
||||
(result == DeepState_TestRunFail))) {
|
||||
abort();
|
||||
assert(0); // Terminate the testing in a way AFL/etc. can see as a crash
|
||||
}
|
||||
|
||||
return result;
|
||||
@@ -783,7 +783,7 @@ extern int LLVMFuzzerTestOneInput(const uint8_t *Data, size_t Size) {
|
||||
const char* abort_check = getenv("LIBFUZZER_ABORT_ON_FAIL");
|
||||
if (abort_check != NULL) {
|
||||
if ((result == DeepState_TestRunFail) || (result == DeepState_TestRunCrash)) {
|
||||
abort();
|
||||
assert(0); // Terminate the testing more permanently
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user