]> git.ipfire.org Git - thirdparty/gcc.git/commit
Ada: Fix segfault for instantiation on function call returning string
authorEric Botcazou <ebotcazou@adacore.com>
Mon, 3 Nov 2025 23:40:39 +0000 (00:40 +0100)
committerEric Botcazou <ebotcazou@adacore.com>
Mon, 3 Nov 2025 23:42:46 +0000 (00:42 +0100)
commit7bdac5a4a5cdf896d0358ea576439b3c3321ef22
treee4805888354097808ae6d904c2b5d09c88dd5125
parentf4367c6b7b7229835fb8786d85a853cb4641b29c
Ada: Fix segfault for instantiation on function call returning string

The problem is that a transient scope is created during the analysis of the
actual parameters of the instantiation and this discombobulates the complex
handling of scopes in Sem_Ch12.

gcc/ada/
PR ada/78175
* sem_ch12.adb (Hide_Current_Scope): Deal with a transient scope
as current scope.
(Remove_Parent): Likewise.

gcc/testsuite/
* gnat.dg/generic_inst15.adb: New test.
* gnat.dg/generic_inst15_pkg-g.ads: New helper.
* gnat.dg/generic_inst15_pkg.ads: Likewise.
gcc/ada/sem_ch12.adb
gcc/testsuite/gnat.dg/generic_inst15.adb [new file with mode: 0644]
gcc/testsuite/gnat.dg/generic_inst15_pkg-g.ads [new file with mode: 0644]
gcc/testsuite/gnat.dg/generic_inst15_pkg.ads [new file with mode: 0644]