diff mbox series

[Ada] Ravenscar simple barriers and validity checks

Message ID 20170918095535.GA78101@adacore.com
State New
Headers show
Series [Ada] Ravenscar simple barriers and validity checks | expand

Commit Message

Pierre-Marie de Rodat Sept. 18, 2017, 9:55 a.m. UTC
If validity checks are enabled in Ravenscar mode, avoid incorrect error
messages complaining that simple barriers are not simple.

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

2017-09-18  Bob Duff  <duff@adacore.com>

	* exp_ch9.adb (Is_Simple_Barrier_Name): Follow Original_Node, in case
	validity checks have rewritten the tree.
diff mbox series

Patch

Index: exp_ch9.adb
===================================================================
--- exp_ch9.adb	(revision 252907)
+++ exp_ch9.adb	(working copy)
@@ -6000,11 +6000,13 @@ 
 
       begin
          --  Check if the name is a component of the protected object. If
-         --  the expander is active, the component has been transformed into
-         --  a renaming of _object.all.component.
+         --  the expander is active, the component has been transformed into a
+         --  renaming of _object.all.component. Original_Node is needed in case
+         --  validity checking is enabled, in which case the simple object
+         --  reference will have been rewritten.
 
          if Expander_Active then
-            Renamed := Renamed_Object (Entity (N));
+            Renamed := Renamed_Object (Entity (Original_Node (N)));
 
             return
               Present (Renamed)