[Ada] Prevent crashes when pretty-printing freeze nodes from gdb

Pierre-Marie de Rodat derodat@adacore.com
Tue Oct 20 07:23:31 GMT 2020


With recently enabled data validity checking in development builds
routine "ps", when called from gdb to examine the AST, might crash on
invalid data.  This is because its Sprint_Node_Actual callee reads
Dump_Freeze_Null global variable when processing nodes of
N_Freeze_Entity and this global variable is not initialized by default.

Found while working on inheritance of the Default_Initial_Condition
pragma.  Compilation is not affected.

Tested on x86_64-pc-linux-gnu, committed on trunk

gcc/ada/

	* sprint.adb (po): Set Dump_Freeze_Null to False; align colons.
	(ps): Likewise.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: patch.diff
Type: text/x-diff
Size: 739 bytes
Desc: not available
URL: <https://gcc.gnu.org/pipermail/gcc-patches/attachments/20201020/5414a3e0/attachment-0001.bin>


More information about the Gcc-patches mailing list