fixes & enhancements to location information associated w/ AST nodes & ZAM optimization

This commit is contained in:
Vern Paxson 2024-01-25 13:11:56 -08:00 committed by Arne Welzel
parent 7a283afe00
commit e5bb63c662
14 changed files with 299 additions and 259 deletions

View file

@ -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;