mirror of
https://github.com/zeek/zeek.git
synced 2025-10-02 14:48:21 +00:00
fix for script profiling of lambda functions
This commit is contained in:
parent
ee88aa3acb
commit
77ca9ae013
1 changed files with 4 additions and 2 deletions
|
@ -93,7 +93,7 @@ public:
|
|||
ScriptProfile(const Func* _func, const detail::StmtPtr& body)
|
||||
: ScriptProfileStats(_func->Name())
|
||||
{
|
||||
func = _func;
|
||||
func = {NewRef{}, const_cast<Func*>(_func)};
|
||||
is_BiF = body == nullptr;
|
||||
|
||||
if ( is_BiF )
|
||||
|
@ -124,7 +124,9 @@ public:
|
|||
void Report(FILE* f) const;
|
||||
|
||||
private:
|
||||
const Func* func;
|
||||
// We store "func" as a FuncPtr to ensure it sticks around when
|
||||
// it would otherwise be ephemeral (i.e., for lambdas).
|
||||
FuncPtr func;
|
||||
bool is_BiF;
|
||||
detail::Location loc;
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue