2015-10-23 Tristan Gingold <gingold@adacore.com>
authorcharlet <charlet@138bc75d-0d04-0410-961f-82ee72b054a4>
Fri, 23 Oct 2015 13:01:23 +0000 (13:01 +0000)
committercharlet <charlet@138bc75d-0d04-0410-961f-82ee72b054a4>
Fri, 23 Oct 2015 13:01:23 +0000 (13:01 +0000)
* gcc-interface/utils2.c (build_call_alloc_dealloc): Check no implicit
task and protected object restrictions.

git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@229252 138bc75d-0d04-0410-961f-82ee72b054a4

gcc/ada/ChangeLog
gcc/ada/gcc-interface/utils2.c

index 941ce25..28cc00c 100644 (file)
@@ -1,3 +1,8 @@
+2015-10-23  Tristan Gingold  <gingold@adacore.com>
+
+       * gcc-interface/utils2.c (build_call_alloc_dealloc): Check no implicit
+       task and protected object restrictions.
+
 2015-10-23  Hristian Kirtchev  <kirtchev@adacore.com>
 
        * sem_ch12.adb, exp_ch6.adb: Minor reformatting.
index 13421b4..ce1a2f2 100644 (file)
@@ -2329,8 +2329,13 @@ build_call_alloc_dealloc (tree gnu_obj, tree gnu_size, tree gnu_type,
 
       /* Check that we aren't violating the associated restriction.  */
       if (!(Nkind (gnat_node) == N_Allocator && Comes_From_Source (gnat_node)))
-       Check_No_Implicit_Heap_Alloc (gnat_node);
-
+       {
+         Check_No_Implicit_Heap_Alloc (gnat_node);
+         if (Has_Task (Etype (gnat_node)))
+           Check_No_Implicit_Task_Alloc (gnat_node);
+         if (Has_Protected (Etype (gnat_node)))
+           Check_No_Implicit_Protected_Alloc (gnat_node);
+       }
       return maybe_wrap_malloc (gnu_size, gnu_type, gnat_node);
     }
 }