Commit 72098128 by James E Wilson Committed by Laurent Guerby

re PR ada/23427 (latent bug with array type size check)

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
parent f2bd1eb9
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
......
......@@ -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)))
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment