phylum-dev/vuln-reach

Review assumptions for `SymbolTableBuilder::root_scope` method

andreaphylum opened this issue · 0 comments

The current implementation for SymbolTableBuilder::root_scope uses an iterator to find the scope with level == 0.

There is a chance that, by construction, this is always the first scope on the stack.

We should validate that assumption; if applicable, consider whether changing the implementation of root_scope to point to the first element instead of using an iterator could be a beneficial performance optimization.