ada: Fix crash during function return analysis
commit9f355ec846c6dd7a9f4f5ba22eb8642c0b4f37ff
authorMarc Poulhiès <poulhies@adacore.com>
Tue, 7 Mar 2023 15:35:48 +0000 (7 16:35 +0100)
committerMarc Poulhiès <poulhies@adacore.com>
Thu, 25 May 2023 07:44:17 +0000 (25 09:44 +0200)
tree266474154f27ccb7413565217ab3204617fe036c
parent8f7eeaa80e58af3885107d67679b2f8ca8dcb2f8
ada: Fix crash during function return analysis

The compiler would crash when checking type relation between the
function's return type and the type of the expression used in the return
statement. It would not work if the function's return type is an access
type and the expression is not.

gcc/ada/

* sem_ch6.adb (Analyze_Function_Return): Add missing
Is_Access_Type check before accessing the Designated_Type field.
gcc/ada/sem_ch6.adb