From f66ebbc8e2e07bc5e1b75b6708f2f209229f6bec Mon Sep 17 00:00:00 2001 From: chriseth Date: Thu, 16 Feb 2017 18:05:11 +0100 Subject: Report failures correctly to AFL. --- test/fuzzer.cpp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'test/fuzzer.cpp') diff --git a/test/fuzzer.cpp b/test/fuzzer.cpp index 5e46662e..85a8fe99 100644 --- a/test/fuzzer.cpp +++ b/test/fuzzer.cpp @@ -55,14 +55,14 @@ int main() if (!Json::Reader().parse(outputString, outputJson)) { cout << "Compiler produced invalid JSON output." << endl; - return -1; + abort(); } if (outputJson.isMember("errors")) { if (!outputJson["errors"].isArray()) { cout << "Output JSON has \"errors\" but it is not an array." << endl; - return -1; + abort(); } for (Json::Value const& error: outputJson["errors"]) { @@ -79,14 +79,14 @@ int main() if (!invalid.empty()) { cout << "Invalid error: \"" << invalid << "\"" << endl; - return -1; + abort(); } } } else if (!outputJson.isMember("contracts")) { cout << "Output JSON has neither \"errors\" nor \"contracts\"." << endl; - return -1; + abort(); } return 0; } -- cgit