re PR ada/23427 (latent bug with array type size check)
authorJames E Wilson <wilson@specifixinc.com>
Thu, 3 Nov 2005 22:13:03 +0000 (22:13 +0000)
committerLaurent Guerby <guerby@gcc.gnu.org>
Thu, 3 Nov 2005 22:13:03 +0000 (22:13 +0000)
2005-11-03  James E Wilson  <wilson@specifix.com>

PR ada/23427
        * trans.c (gnat_to_gnu): Use TYPE_SIZE_UNIT not TYPE_SIZE in
        TREE_OVERFLOW check.

From-SVN: r106452

gcc/ada/ChangeLog
gcc/ada/trans.c

index 31f324a142b486c26e3d9ca759087f81b8beb030..3239df20cd4898fe7e9ceb79d1178f2d2410bbbb 100644 (file)
@@ -1,3 +1,9 @@
+2005-11-03  James E Wilson  <wilson@specifix.com>
+
+       PR ada/23427
+        * trans.c (gnat_to_gnu): Use TYPE_SIZE_UNIT not TYPE_SIZE in
+        TREE_OVERFLOW check.
+
 2005-09-21  Olivier Hainque  <hainque@adacore.com>
 
        PR ada/22418
index 0e05b6d473144824fed2bf3197bfbabe572b6305..cd91a368328fcbadb7ef792dd9ea8decea65cf64 100644 (file)
@@ -3423,8 +3423,8 @@ gnat_to_gnu (Node_Id gnat_node)
 
       /* If the type has a size that overflows, convert this into raise of
         Storage_Error: execution shouldn't have gotten here anyway.  */
-      if (TREE_CODE (TYPE_SIZE (TREE_TYPE (gnu_lhs))) == INTEGER_CST
-          && TREE_OVERFLOW (TYPE_SIZE (TREE_TYPE (gnu_lhs))))
+      if (TREE_CODE (TYPE_SIZE_UNIT (TREE_TYPE (gnu_lhs))) == INTEGER_CST
+         && TREE_OVERFLOW (TYPE_SIZE_UNIT (TREE_TYPE (gnu_lhs))))
        gnu_result = build_call_raise (SE_Object_Too_Large);
       else if (Nkind (Expression (gnat_node)) == N_Function_Call
               && !Do_Range_Check (Expression (gnat_node)))