mirror of
https://github.com/zeek/zeek.git
synced 2025-10-02 14:48:21 +00:00
Disable Stmt hooks for the built-in debugger if not a debug build
This commit is contained in:
parent
fcd94157e1
commit
e7aad5e3e0
1 changed files with 12 additions and 0 deletions
12
src/Stmt.cc
12
src/Stmt.cc
|
@ -147,6 +147,7 @@ const AssertStmt* Stmt::AsAssertStmt() const {
|
||||||
}
|
}
|
||||||
|
|
||||||
bool Stmt::SetLocationInfo(const Location* start, const Location* end) {
|
bool Stmt::SetLocationInfo(const Location* start, const Location* end) {
|
||||||
|
#if DEBUG
|
||||||
if ( ! Obj::SetLocationInfo(start, end) )
|
if ( ! Obj::SetLocationInfo(start, end) )
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
|
@ -177,6 +178,9 @@ bool Stmt::SetLocationInfo(const Location* start, const Location* end) {
|
||||||
}
|
}
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
|
#else
|
||||||
|
return Obj::SetLocationInfo(start, end);
|
||||||
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
bool Stmt::IsPure() const { return false; }
|
bool Stmt::IsPure() const { return false; }
|
||||||
|
@ -436,13 +440,17 @@ ValPtr IfStmt::DoExec(Frame* f, Val* v, StmtFlowType& flow) {
|
||||||
|
|
||||||
f->SetNextStmt(do_stmt);
|
f->SetNextStmt(do_stmt);
|
||||||
|
|
||||||
|
#if DEBUG
|
||||||
if ( ! pre_execute_stmt(do_stmt, f) ) { // ### Abort or something
|
if ( ! pre_execute_stmt(do_stmt, f) ) { // ### Abort or something
|
||||||
}
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
auto result = do_stmt->Exec(f, flow);
|
auto result = do_stmt->Exec(f, flow);
|
||||||
|
|
||||||
|
#if DEBUG
|
||||||
if ( ! post_execute_stmt(do_stmt, f, result.get(), &flow) ) { // ### Abort or something
|
if ( ! post_execute_stmt(do_stmt, f, result.get(), &flow) ) { // ### Abort or something
|
||||||
}
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
@ -1409,13 +1417,17 @@ ValPtr StmtList::Exec(Frame* f, StmtFlowType& flow) {
|
||||||
|
|
||||||
f->SetNextStmt(stmt);
|
f->SetNextStmt(stmt);
|
||||||
|
|
||||||
|
#if DEBUG
|
||||||
if ( ! pre_execute_stmt(stmt, f) ) { // ### Abort or something
|
if ( ! pre_execute_stmt(stmt, f) ) { // ### Abort or something
|
||||||
}
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
auto result = stmt->Exec(f, flow);
|
auto result = stmt->Exec(f, flow);
|
||||||
|
|
||||||
|
#if DEBUG
|
||||||
if ( ! post_execute_stmt(stmt, f, result.get(), &flow) ) { // ### Abort or something
|
if ( ! post_execute_stmt(stmt, f, result.get(), &flow) ) { // ### Abort or something
|
||||||
}
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
if ( flow != FLOW_NEXT || result || f->HasDelayed() )
|
if ( flow != FLOW_NEXT || result || f->HasDelayed() )
|
||||||
return result;
|
return result;
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue