Ada Fixes Crash on Declare Expression in Contract on Access to Subprogram Type.
The Ada compiler no longer crashes when using a declare expression in a contract on access to a subprogram type.
The Ada compiler previously crashed when a declare expression was used in a contract applied to an access-to-subprogram type. This commit fixes the crash by adding the missing Scope_Depth_Value field to the E_Subprogram_Type enumeration in gen_il-gen-gen_entities.adb. This field is required for proper scope management.
In Details
The Ada compiler's intermediate language generation phase (gen_il-gen-gen_entities.adb) defines various entity types, including E_Subprogram_Type. This commit addresses a missing field (Scope_Depth_Value) in the definition of E_Subprogram_Type, which caused a crash when declare expressions were used in contracts related to access-to-subprogram types. The fix ensures that scope depths are properly tracked during code generation.
For Context
In Ada, contracts allow programmers to specify expected behavior of subprograms (functions and procedures). This commit fixes a bug that caused the compiler to crash when a specific type of expression (a declare expression) was used within a contract applied to a pointer to a subprogram. This fix improves the stability of the compiler when working with advanced language features.