mirror of
https://github.com/zeek/zeek.git
synced 2025-10-10 18:48:20 +00:00
fixes & enhancements to location information associated w/ AST nodes & ZAM optimization
This commit is contained in:
parent
7a283afe00
commit
e5bb63c662
14 changed files with 299 additions and 259 deletions
|
@ -680,8 +680,10 @@ StmtPtr ScriptFunc::AddInits(StmtPtr body, const std::vector<IDPtr>& inits) {
|
|||
if ( inits.empty() )
|
||||
return body;
|
||||
|
||||
auto stmt_series = make_intrusive<StmtList>();
|
||||
stmt_series->Stmts().push_back(make_intrusive<InitStmt>(inits));
|
||||
auto stmt_series = with_location_of(make_intrusive<StmtList>(), body);
|
||||
auto init = with_location_of(make_intrusive<InitStmt>(inits), body);
|
||||
|
||||
stmt_series->Stmts().push_back(std::move(init));
|
||||
stmt_series->Stmts().push_back(std::move(body));
|
||||
|
||||
return stmt_series;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue