#include "fuzz_ops.h" #include "vm_apply.h" #include "vm_defs.h" #include "vm_parse.h" #include #include #include #include namespace NSc::NUt { void FuzzOps(TStringBuf wire, bool log) { if (log) { NImpl::GetTlsInstance().ReportingMode = NImpl::TSelfLoopContext::EMode::Stderr; } // We start with a single TValue node TVMState st {wire, 1, 0}; while (auto act = ParseNextAction(st)) { if (log) { Cerr << " STATE: " << st.ToString() << Endl; Cerr << "ACTION: " << (act ? act->ToString() : TString("(empty)")) << Endl; } if (!ApplyNextAction(st, *act)) { break; } if (!NSc::TValue::DefaultValue().IsNull()) { std::terminate(); } } } }