Landing: 0e1b0a45dfa0
Project / Subsystem
gcc / ada
Date
2026-01-12
Author
Eric Botcazou
Commit
0e1b0a45dfa044e8500d9ca6a6e6251ca7252f16
Source
github
Perf win
No
Breaking
No
All attributes
- project
- gcc
- subsystem
- ada
- patch_id
- —
- commit_hash
- 0e1b0a45dfa044e8500d9ca6a6e6251ca7252f16
- source_type
- github
- headline
- Ada: Fix finalization of renamed function call at library level
- tldr
- This commit fixes a regression where renaming a controlled function call at the library level could lead to a dangling reference.
- author
- Eric Botcazou
- outcome
- committed
- performance_win
- false
- breaking_change
- false
- series_id
- —
- series_parts
- []
- tags
-
- • ada
- • finalization
- • controlled types
- • regression
- discussion_id_link
- —
- bugzilla_pr
- —
- date
- 2026-01-12T00:00:00.000Z
This commit addresses a regression that caused incorrect finalization when a controlled function call was renamed at the library level. The compiler would create a dangling reference to a temporary object on the elaboration routine’s stack, leading to potential errors. The fix ensures that the renaming is handled correctly by either bailing out in Expand_Ctrl_Function_Call or rewriting the renaming as a regular object declaration in Expand_N_Object_Renaming_Declaration.