mirror of
https://github.com/revng/revng
synced 2026-06-21 14:07:57 +00:00
18054eeee2
This commit fixes a situation where CollapseSingleChild could introduce infinite loops composed entirely of pointer edges, which would end up in making the DLA backend go out-of-memory. This happened when collapsing a Child at offset 0 into a Parent node, when Child had a pointer edge going to Parent. The pointer edge needed not to be at step one, but it could possibly be a pointer-to-pointer to Parent, at any depth. After merging Child into Parent this would lead to a node pointing to itself, which is a forbidden pointer loop in the graph. This commit catches the pattern and prevents it to merge Child into Parent.