mirror of
https://github.com/zeek/zeek.git
synced 2025-10-10 18:48:20 +00:00
Pop global frame stack on exception.
When changing this code for 3.0.0, the code-flow changed significantly. One of the changes lead to exception being re-thrown from Call - which leads to the function cleanup not always being run. While the Unref of the framepointer was (correctly) moved into the catch block, the global frame stack was not cleaned up - and contains an invalid pointer after encountering an interpreter exception. This small commit pops the stack and removes the framepointer that was pushed onto it before re-throwing the exception. I also think that this change (re-throwing the exception) breaks the Zeek debugger in significant ways (you cannot debug a script that causes a Runtime error anymore).
This commit is contained in:
parent
597407a708
commit
9ff6584953
1 changed files with 1 additions and 0 deletions
|
@ -395,6 +395,7 @@ Val* BroFunc::Call(val_list* args, Frame* parent) const
|
|||
// Already reported, but now determine whether to unwind further.
|
||||
if ( Flavor() == FUNC_FLAVOR_FUNCTION )
|
||||
{
|
||||
g_frame_stack.pop_back();
|
||||
Unref(f);
|
||||
// Result not set b/c exception was thrown
|
||||
throw;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue