This commit is contained in:
Richard Holland
2023-03-07 14:06:54 +00:00
parent 0940843766
commit 7abfc033c0
2 changed files with 8 additions and 1 deletions

View File

@@ -132,6 +132,7 @@ namespace hook
NESTING_LIMIT = 84, // the hook nested blocks/loops/ifs beyond 16 levels
SECTIONS_OUT_OF_SEQUENCE = 85, // the wasm contained sections out of sequence
CUSTOM_SECTION_DISALLOWED = 86, // the wasm contained a custom section (id=0)
INTERNAL_ERROR = 87, // an internal error described by the log text
// RH NOTE: only HookSet msgs got log codes, possibly all Hook log lines should get a code?
};
};

View File

@@ -1260,7 +1260,13 @@ SetHook::setHook()
// if there is only an existing hook, without a HookSetObj then it is
// logically impossible for the operation to not be NOOP
assert(hookSetObj || op == hsoNOOP);
if(!hookSetObj && op != hsoNOOP)
{
JLOG(ctx.j.warn())
<< "HookSet(" << hook::log::INTERNAL_ERROR << ")[" << HS_ACC()
<< "]: Logic error. !hookSetObj && op != hsoNOOP";
return tecINTERNAL;
}
switch (op)
{