phylum-dev / vuln-reach

A library for building tools to determine if vulnerabilities are reachable in a code base.

Home Page:https://phylum.io

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Review assumptions for `SymbolTableBuilder::root_scope` method

andreaphylum opened this issue · 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.