mirror of
https://github.com/zeek/zeek.git
synced 2025-10-17 14:08:20 +00:00
GH-210: improve call stack tracking
Adds tracking of arguments
This commit is contained in:
parent
253adfd14b
commit
3e2c2a6140
7 changed files with 64 additions and 31 deletions
13
src/Expr.cc
13
src/Expr.cc
|
@ -4839,28 +4839,17 @@ Val* CallExpr::Eval(Frame* f) const
|
|||
{
|
||||
const ::Func* func = func_val->AsFunc();
|
||||
const CallExpr* current_call = f ? f->GetCall() : 0;
|
||||
call_stack.emplace_back(CallInfo{this, func});
|
||||
|
||||
if ( f )
|
||||
f->SetCall(this);
|
||||
|
||||
try
|
||||
{
|
||||
ret = func->Call(v, f);
|
||||
}
|
||||
catch ( ... )
|
||||
{
|
||||
call_stack.pop_back();
|
||||
throw;
|
||||
}
|
||||
ret = func->Call(v, f);
|
||||
|
||||
if ( f )
|
||||
f->SetCall(current_call);
|
||||
|
||||
// Don't Unref() the arguments, as Func::Call already did that.
|
||||
delete v;
|
||||
|
||||
call_stack.pop_back();
|
||||
}
|
||||
else
|
||||
delete_vals(v);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue