mirror of
https://github.com/zeek/zeek.git
synced 2025-10-02 06:38:20 +00:00
fix line numbers associated with "if" and initialization statements
This commit is contained in:
parent
e4dab3dded
commit
46d0b55417
1 changed files with 1 additions and 5 deletions
|
@ -426,10 +426,6 @@ IfStmt::IfStmt(ExprPtr test, StmtPtr arg_s1, StmtPtr arg_s2)
|
|||
: ExprStmt(STMT_IF, std::move(test)), s1(std::move(arg_s1)), s2(std::move(arg_s2)) {
|
||||
if ( ! e->IsError() && ! IsBool(e->GetType()->Tag()) )
|
||||
e->Error("conditional in test must be boolean");
|
||||
|
||||
const Location* loc1 = s1->GetLocationInfo();
|
||||
const Location* loc2 = s2->GetLocationInfo();
|
||||
SetLocationInfo(loc1, loc2);
|
||||
}
|
||||
|
||||
IfStmt::~IfStmt() = default;
|
||||
|
@ -1488,7 +1484,7 @@ InitStmt::InitStmt(std::vector<IDPtr> arg_inits) : Stmt(STMT_INIT) {
|
|||
inits = std::move(arg_inits);
|
||||
|
||||
if ( ! inits.empty() )
|
||||
SetLocationInfo(inits[0]->GetLocationInfo());
|
||||
SetLocationInfo(inits.front()->GetLocationInfo(), inits.back()->GetLocationInfo());
|
||||
}
|
||||
|
||||
ValPtr InitStmt::Exec(Frame* f, StmtFlowType& flow) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue