Skip to content

Commit

Permalink
Update symtab after inline visitor which invalidates it for the inlined
Browse files Browse the repository at this point in the history
blocks
  • Loading branch information
iomaganaris committed Nov 14, 2023
1 parent a0681f0 commit 43cba4c
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 1 deletion.
1 change: 1 addition & 0 deletions src/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -443,6 +443,7 @@ int main(int argc, const char* argv[]) {
if (nmodl_inline) {
logger->info("Running nmodl inline visitor");
InlineVisitor().visit_program(*ast);
SymtabVisitor(update_symtab).visit_program(*ast);

Check warning on line 446 in src/main.cpp

View check run for this annotation

Codecov / codecov/patch

src/main.cpp#L446

Added line #L446 was not covered by tests
ast_to_nmodl(*ast, filepath("inline"));
}

Expand Down
1 change: 0 additions & 1 deletion src/visitors/inline_visitor.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -173,7 +173,6 @@ bool InlineVisitor::inline_function_call(ast::Block& callee,
RenameVisitor visitor(function_name, new_varname);
inlined_block->visit_children(visitor);

/// \todo Have to re-run symtab visitor pass to update symbol table
inlined_block->set_symbol_table(nullptr);

/// each argument is added as new assignment statement
Expand Down

0 comments on commit 43cba4c

Please sign in to comment.