Skip to content

Refactor the PersistentSymbolTable API to prevent unsafe access

Milian Wolff requested to merge work/safer-persistentsymboltable into master

Instead of handing out raw iterators to data that is stored within the symbol table, force users to pass a visitor instead.

This has the nice side effect that we can hide way more of the persistent symbol table internals. We can now also get rid of the extra mutex for the caches, as we only touch them while we have the repository mutex locked.

The downside is that the callee loops are all a bit more tedious to write, as we can't just break or continue directly anymore and instead have to return a special Break or Continue value from the visitor instead.

Fixes: #10 (closed)

Merge request reports