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

Codeview avoids infinite loop for declaration-only array types.

Codeview now correctly handles array types where the element type is a declaration-only debug info entry, preventing infinite loops.

This change modifies the CodeView debug info generation to prevent infinite loops when encountering array types whose elements are represented by declaration-only DIEs. Previously, the absence of a size for such elements caused the type-chain walk to stall. The fix ensures the walk terminates and allows existing size checks to handle these cases, improving debug information accuracy for C++ code.

In Details

The get_type_num_array_type function in dwarf2codeview.cc previously entered an infinite loop when encountering array types with declaration-only element DIEs (which lack DW_AT_byte_size). This commit adjusts the logic to terminate the type-chain walk after processing the element type, relying on subsequent checks for valid element sizes. This ensures that declaration-only types do not halt the CodeView generation process.

Filed Under: debugcodeviewc++