This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
[Ada] Add missing size check
- To: gcc-patches at gcc dot gnu dot org
- Subject: [Ada] Add missing size check
- From: Geert Bosch <bosch at gnat dot com>
- Date: Wed, 10 Oct 2001 18:01:49 -0400 (EDT)
I applied the following for Richard. -Geert
2001-10-10 Richard Kenner <kenner@gnat.com>
* decl.c: (validate_size): Do check size of object of integral type
if it is a packed array type.
*** decl.c 2001/10/04 20:22:57 1.5
--- decl.c 2001/10/06 12:58:02 1.6
*************** validate_size (uint_size, gnu_type, gnat
*** 5516,5522 ****
need not do it here (which would entail checking against the bounds).
However, if this is an aliased object, it may not be smaller than the
type of the object. */
! if (INTEGRAL_TYPE_P (gnu_type)
&& ! (kind == VAR_DECL && Is_Aliased (gnat_object)))
return size;
--- 5516,5522 ----
need not do it here (which would entail checking against the bounds).
However, if this is an aliased object, it may not be smaller than the
type of the object. */
! if (INTEGRAL_TYPE_P (gnu_type) && ! TYPE_PACKED_ARRAY_TYPE_P (gnu_type)
&& ! (kind == VAR_DECL && Is_Aliased (gnat_object)))
return size;