FRIDAY, SEPTEMBER 25, 2026
except
except: Use chain_next on eh_region_d for GTY
Adds linked list pointers to exception handling structures to prevent stack overflows during garbage collection.
This commit introduces chain_next pointers to the eh_region_d structure within GCC’s exception handling. This change addresses potential stack overflows during garbage collection that can occur with a large number of local variables requiring cleanups, similar to a previous fix for eh_landing_pad_d.
In Details
To prevent stack overflows during garbage collection of deeply nested eh_region_d structures, a chain_next pointer is added, marked with GTY. This mirrors a previous change for eh_landing_pad_d and aims to stabilize exception handling when numerous local variables necessitate cleanup regions.
For Context
- eh_region_d
- A data structure used in GCC's exception handling to represent a region of code that may require special cleanup actions.
- GTY
- A GCC-specific mechanism for garbage collecting compiler data structures. It requires special markers for fields that are part of linked lists or trees.
- stack overflow
- An error condition that occurs when a program exceeds the allocated stack memory, often due to excessively deep function calls or recursive data structures.