mirror of
https://github.com/zeek/zeek.git
synced 2025-10-13 20:18:20 +00:00
fix for avoiding inadvertent interpreter errors in CallExpr::IsPure()
This commit is contained in:
parent
37fcb231fa
commit
11e9135f80
1 changed files with 6 additions and 2 deletions
|
@ -4070,11 +4070,15 @@ bool CallExpr::IsPure() const {
|
||||||
if ( IsError() )
|
if ( IsError() )
|
||||||
return true;
|
return true;
|
||||||
|
|
||||||
if ( ! func->IsPure() )
|
if ( func->Tag() != EXPR_NAME )
|
||||||
|
// Indirect call, can't resolve up front.
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
auto func_val = func->Eval(nullptr);
|
auto func_id = func->AsNameExpr()->Id();
|
||||||
|
if ( ! func_id->IsGlobal() )
|
||||||
|
return false;
|
||||||
|
|
||||||
|
auto func_val = func_id->GetVal();
|
||||||
if ( ! func_val )
|
if ( ! func_val )
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue