Fix crash on incorrect record field renaming.
This commit fixes a crash in the Ada compiler that occurred during incorrect renaming of record fields.
The Ada compiler could crash when handling incorrect renaming of record fields. This commit adds a check in sem_ch8.adb (Find_Renamed_Entity) to protect a call to First_Formal, resolving the crash. This improves the compiler’s robustness when dealing with invalid code.
In Details
This commit addresses a crash in sem_ch8.adb (Find_Renamed_Entity) related to renaming record fields. The fix involves protecting a call to First_Formal, likely to prevent dereferencing a null pointer or accessing an invalid memory location.
For Context
Record field renaming allows programmers to assign new names to existing fields within a record or struct. This commit fixes a bug in the Ada compiler that could cause it to crash when handling incorrect renaming of record fields. The fix makes the compiler more robust and prevents it from crashing when encountering invalid code.