mirror of
https://github.com/zeek/zeek.git
synced 2025-10-12 03:28:19 +00:00
basic framework in place for rigorously assessing side effects
This commit is contained in:
parent
b0a200a5dc
commit
b645336b5d
12 changed files with 1686 additions and 54 deletions
|
@ -911,6 +911,31 @@ TraversalCode CSE_ValidityChecker::PreExpr(const Expr* e) {
|
|||
|
||||
case EXPR_CALL:
|
||||
if ( sensitive_to_calls ) {
|
||||
auto c = e->AsCallExpr();
|
||||
auto func = c->Func();
|
||||
std::string desc;
|
||||
if ( func->Tag() == EXPR_NAME ) {
|
||||
auto f = func->AsNameExpr()->Id();
|
||||
if ( f->IsGlobal() ) {
|
||||
auto func_v = f->GetVal();
|
||||
if ( func_v ) {
|
||||
auto func_vf = func_v->AsFunc();
|
||||
|
||||
if ( func_vf->GetKind() == Func::SCRIPT_FUNC )
|
||||
desc = "script";
|
||||
else
|
||||
desc = "BiF";
|
||||
}
|
||||
else
|
||||
desc = "missing";
|
||||
}
|
||||
else
|
||||
desc = "indirect";
|
||||
}
|
||||
else
|
||||
desc = "compound-indirect";
|
||||
|
||||
// printf("call sensitivity: %s %s\n", desc.c_str(), obj_desc(e).c_str());
|
||||
is_valid = false;
|
||||
return TC_ABORTALL;
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue