Add basic structure for fuzzing targets

General changes:

* Add -D/--deterministic command line option as
  convenience/alternative to -G/--load-seeds (i.e. no file needed, it just
  uses zero-initialized random seeds).  It also changes Broker data
  stores over to using deterministic timing rather than real time.

* Add option to make Reporter abort on runtime scripting errors
This commit is contained in:
Jon Siwek 2020-04-21 20:16:00 -07:00
parent f849571910
commit 8f1b34b915
20 changed files with 1290 additions and 928 deletions

View file

@ -32,8 +32,9 @@ int closelog();
Reporter* reporter = nullptr;
Reporter::Reporter()
Reporter::Reporter(bool arg_abort_on_scripting_errors)
{
abort_on_scripting_errors = arg_abort_on_scripting_errors;
errors = 0;
via_events = false;
in_error_handler = 0;
@ -157,6 +158,10 @@ void Reporter::ExprRuntimeError(const Expr* expr, const char* fmt, ...)
d.Description(), fmt, ap);
va_end(ap);
PopLocation();
if ( abort_on_scripting_errors )
abort();
throw InterpreterException();
}
@ -170,6 +175,10 @@ void Reporter::RuntimeError(const Location* location, const char* fmt, ...)
DoLog("runtime error", reporter_error, out, nullptr, nullptr, true, true, "", fmt, ap);
va_end(ap);
PopLocation();
if ( abort_on_scripting_errors )
abort();
throw InterpreterException();
}