From: Paul Cruz Date: Fri, 9 Jun 2017 20:41:34 +0000 (-0700) Subject: added error function for different compilation modes X-Git-Tag: v1.3.0~1^2~26^2~1 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=be9b0ae627f68ee428aa70258dd0f3b4e119ecad;p=thirdparty%2Fzstd.git added error function for different compilation modes --- diff --git a/tests/roundTripCrash.c b/tests/roundTripCrash.c index a296d4160..88282b45d 100644 --- a/tests/roundTripCrash.c +++ b/tests/roundTripCrash.c @@ -68,6 +68,15 @@ static size_t checkBuffers(const void* buff1, const void* buff2, size_t buffSize return pos; } +static void crashWithMessage(const char* message, int errorCode){ + /* abort if AFL/libfuzzer, exit otherwise */ + fprintf(stderr, "%s", message); + #ifdef FUZZING_BUILD_MODE_UNSAFE_FOR_PRODUCTION /* could also use __AFL_COMPILER */ + abort(); + #else + exit(errorCode); + #endif +} static void roundTripCheck(const void* srcBuff, size_t srcBuffSize) {