GCC Newspaper
NOVEMBER 30, 2026
Date
/
Architectures
Components
Topics
News & Policy
Other
codeview

Codeview handles nested types in anonymous structures.

Fixes infinite recursion in CodeView generation when processing nested types within anonymous structures.

This commit addresses an issue in CodeView debug info generation where visiting a nested type’s parent could lead to infinite recursion within unfinished anonymous structures. The solution defers parent processing until the nested type is complete and handles deferred parent definitions. It also ensures distinct types, even when unnamed, are kept complete to avoid issues with indistinguishable forward references.

In Details

In dwarf2codeview.cc, get_type_num_struct previously suffered from re-entrancy issues when handling nested types within anonymous structures. Visiting a parent type could lead to infinite recursion if the nested type's structure was not yet complete. This patch defers processing of parent definitions until the nested type is finalized and correctly handles types appended during the flushing of deferred types. It also ensures that complete definitions are maintained for unnamed member types to differentiate them from forward references.

Filed Under: debugcodeviewc++