diff options
author | Arnaud Charlet <charlet@gcc.gnu.org> | 2012-02-22 14:47:23 +0100 |
---|---|---|
committer | Arnaud Charlet <charlet@gcc.gnu.org> | 2012-02-22 14:47:23 +0100 |
commit | 84c4181d3b2b772d5e5efba12ed215834c862fc6 (patch) | |
tree | 8aa5baea8ab81c655c592aaedb0bd67070fd490d /gcc | |
parent | bbd6a014640b668d38004deb8f647303e2347ac5 (diff) | |
download | gcc-84c4181d3b2b772d5e5efba12ed215834c862fc6.zip gcc-84c4181d3b2b772d5e5efba12ed215834c862fc6.tar.gz gcc-84c4181d3b2b772d5e5efba12ed215834c862fc6.tar.bz2 |
[multiple changes]
2012-02-22 Ed Schonberg <schonberg@adacore.com>
* freeze.adb (Freeze_Entity): Do not perform type layout within
a generic unit.
2012-02-22 Eric Botcazou <ebotcazou@adacore.com>
* init.c (__gnat_error_handler) [Linux]: Map SIGBUS to
Storage_Error.
2012-02-22 Ed Schonberg <schonberg@adacore.com>
* exp_ch5.adb (Expand_N_Assignment_Statement): Reject an
assignment to a classwide type whose type is limited, as
can happen in an instantiation in programs that run afoul or
AI05-0087.
From-SVN: r184471
Diffstat (limited to 'gcc')
-rw-r--r-- | gcc/ada/ChangeLog | 18 | ||||
-rw-r--r-- | gcc/ada/exp_ch5.adb | 15 | ||||
-rw-r--r-- | gcc/ada/freeze.adb | 8 | ||||
-rw-r--r-- | gcc/ada/init.c | 6 |
4 files changed, 40 insertions, 7 deletions
diff --git a/gcc/ada/ChangeLog b/gcc/ada/ChangeLog index be95913..8204c04 100644 --- a/gcc/ada/ChangeLog +++ b/gcc/ada/ChangeLog @@ -1,3 +1,21 @@ +2012-02-22 Ed Schonberg <schonberg@adacore.com> + + * freeze.adb (Freeze_Entity): Do not perform type layout within + a generic unit. + +2012-02-22 Eric Botcazou <ebotcazou@adacore.com> + + * init.c (__gnat_error_handler) [Linux]: Map SIGBUS to + Storage_Error. + +2012-02-22 Ed Schonberg <schonberg@adacore.com> + + * exp_ch5.adb (Expand_N_Assignment_Statement): Reject an + assignment to a classwide type whose type is limited, as + can happen in an instantiation in programs that run afoul or + AI05-0087. + + 2012-02-17 Ed Schonberg <schonberg@adacore.com> * exp_ch6.adb (Legal_Copy): If layout is not diff --git a/gcc/ada/exp_ch5.adb b/gcc/ada/exp_ch5.adb index 34ff36a..7eb224d 100644 --- a/gcc/ada/exp_ch5.adb +++ b/gcc/ada/exp_ch5.adb @@ -6,7 +6,7 @@ -- -- -- B o d y -- -- -- --- Copyright (C) 1992-2011, Free Software Foundation, Inc. -- +-- Copyright (C) 1992-2012, Free Software Foundation, Inc. -- -- -- -- GNAT is free software; you can redistribute it and/or modify it under -- -- terms of the GNU General Public License as published by the Free Soft- -- @@ -28,6 +28,7 @@ with Atree; use Atree; with Checks; use Checks; with Debug; use Debug; with Einfo; use Einfo; +with Errout; use Errout; with Exp_Aggr; use Exp_Aggr; with Exp_Ch6; use Exp_Ch6; with Exp_Ch7; use Exp_Ch7; @@ -2086,6 +2087,18 @@ package body Exp_Ch5 is and then not Restriction_Active (No_Dispatching_Calls)) then + if Is_Limited_Type (Typ) then + + -- This can happen in an instance when the formal is an + -- extension of a limited interface, and the actual is + -- limited. This is an error according to AI05-0087, but + -- is not caught at the point of instantiation in earlier + -- versions. + + Error_Msg_N ("assignment not available on limited type", N); + return; + end if; + -- Fetch the primitive op _assign and proper type to call it. -- Because of possible conflicts between private and full view, -- fetch the proper type directly from the operation profile. diff --git a/gcc/ada/freeze.adb b/gcc/ada/freeze.adb index 6325b45..15bd6e0 100644 --- a/gcc/ada/freeze.adb +++ b/gcc/ada/freeze.adb @@ -4407,10 +4407,12 @@ package body Freeze is -- the size and alignment values. This processing is not required for -- generic types, since generic types do not play any part in code -- generation, and so the size and alignment values for such types - -- are irrelevant. + -- are irrelevant. Ditto for types declared within a generic unit, + -- which may have components that depend on generic parameters, and + -- that will be recreated in an instance. - if Is_Generic_Type (E) then - return Result; + if Inside_A_Generic then + null; -- Otherwise we call the layout procedure diff --git a/gcc/ada/init.c b/gcc/ada/init.c index 79c5c5b..c2fd46b 100644 --- a/gcc/ada/init.c +++ b/gcc/ada/init.c @@ -6,7 +6,7 @@ * * * C Implementation File * * * - * Copyright (C) 1992-2011, Free Software Foundation, Inc. * + * Copyright (C) 1992-2012, Free Software Foundation, Inc. * * * * GNAT is free software; you can redistribute it and/or modify it under * * terms of the GNU General Public License as published by the Free Soft- * @@ -661,8 +661,8 @@ __gnat_error_handler (int sig, siginfo_t *si ATTRIBUTE_UNUSED, void *ucontext) break; case SIGBUS: - exception = &constraint_error; - msg = "SIGBUS"; + exception = &storage_error; + msg = "SIGBUS: possible stack overflow"; break; case SIGFPE: |