utils2.c (build_call_alloc_dealloc): Check no implicit task and protected object...
authorTristan Gingold <gingold@adacore.com>
Fri, 23 Oct 2015 13:01:23 +0000 (13:01 +0000)
committerArnaud Charlet <charlet@gcc.gnu.org>
Fri, 23 Oct 2015 13:01:23 +0000 (15:01 +0200)
2015-10-23  Tristan Gingold  <gingold@adacore.com>

* gcc-interface/utils2.c (build_call_alloc_dealloc): Check no implicit
task and protected object restrictions.

From-SVN: r229252

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

index 941ce252c76264f27376ba27739bee5f1c281a9c..28cc00cf8e0f5b5d758cfadf950f8204525e8561 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 13421b4f0513a1587e580046080110d28c2308d6..ce1a2f2dcb34a6c9404dbeda26ae311d488dcd14 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);
     }
 }