WEDNESDAY, SEPTEMBER 23, 2026
ada
Ada: Prevent crash in generic unit membership test resolution
Adds a guard to prevent a crash during membership test resolution in Ada generic units.
This commit adds a missing guard in the Ada compiler’s semantic resolution logic for membership tests within generic units. This prevents a crash that could occur when checking the runtime size for generic types.
In Details
Adds a guard in sem_res.adb's Resolve_Membership_Op to handle generic types correctly when checking against RM size, preventing a crash.
For Context
- generic unit
- In Ada, a template that can be instantiated to create concrete types or subprograms, allowing for code reuse with different parameter types.
- membership test
- An Ada expression that checks if a value belongs to a specified range or discrete subtype.