mirror of
https://github.com/revng/revng
synced 2026-06-21 14:07:57 +00:00
b6520330fb
This commit fixes a use-after-poison bug. DLADeduplicateUnionFields::runOnTypeSystem iterates over the DLA graph while mutating it. Due to iterations on copies of the edges, there were some edges to dead nodes that were still hanging around and could be accessed. This commit fixes the problem by not saving copies of the edges, but saving LayoutTypeSystemNode * and iterating lazily on the edges starting from the node itself every time. In this way, if the graph is mutated, we never have outdated edges pointing to dead nodes, and we don't have use-after-poison.