[Ada] Compiler abort on in_out function parameter with type invariant

Pierre-Marie de Rodat derodat@adacore.com
Mon Oct 19 09:54:22 GMT 2020


Compiler crashes on a function call when function profile includes
an in_out parameter, the parameter type has an inherited type
invariant, and the actual is a view conversion to an ancestor type.

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

gcc/ada/

	* exp_ch6.adb (Add_View_Conversion_Invariants): Do not insert
	generated invariant checks when the call is a function call.
	These tests are properly inserted in the code in procedure
	Insert_Post_Call_Actions, which takes care of finding the proper
	insertion point for the checks.
	(Insert_Post_Call_Actions): Add question marks to indicate
	possible gap in handling function calls that appear as aggregate
	components.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: patch.diff
Type: text/x-diff
Size: 1126 bytes
Desc: not available
URL: <https://gcc.gnu.org/pipermail/gcc-patches/attachments/20201019/24ae87d5/attachment-0001.bin>


More information about the Gcc-patches mailing list