Skip to content
Snippets Groups Projects
Commit b2453909 authored by Steve Baird's avatar Steve Baird Committed by Marc Poulhiès
Browse files

ada: Rtsfind should not trash state used in analyzing instantiations.

During analysis of an instantiation, Sem_Ch12 manages formal/actual binding
information in package state (see Sem_Ch12.Generic_Renamings_HTable).
A call to rtsfind can cause another unit to be loaded and compiled.
If this occurs during the analysis of an instantiation, and if the loaded
unit contains a second instantiation, then the Sem_Ch12 state needed for
analyzing the first instantiation can be trashed during the analysis of the
second instantiation. Rtsfind calls that can include the analysis of an
instantiation need to save and restore Sem_Ch12's state.

gcc/ada/

	* sem_ch12.ads: Declare new Instance_Context package, which
	declares a private type Context with operations Save_And_Reset and
	Restore.
	* sem_ch12.adb: Provide body for new Instance_Context package.
	* rtsfind.adb (Load_RTU): Wrap an Instance_Context Save/Restore
	call pair around the call to Semantics.
	* table.ads: Add initial value for Last_Val (because
	Save_And_Reset expects Last_Val to be initialized).
parent cad2744c
No related branches found
No related tags found
No related merge requests found
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment