diff options
author | Richard Henderson <rth@redhat.com> | 2004-03-15 16:35:17 -0800 |
---|---|---|
committer | Richard Henderson <rth@gcc.gnu.org> | 2004-03-15 16:35:17 -0800 |
commit | 0977ab3aa6121253392b15c02679a86615f05e1b (patch) | |
tree | 6f83cb950f53a1df02dec8609a2cc0e4816e0d90 /gcc/except.c | |
parent | 199f5c2b84b096f5f2925029d9728bd422eb36da (diff) | |
download | gcc-0977ab3aa6121253392b15c02679a86615f05e1b.zip gcc-0977ab3aa6121253392b15c02679a86615f05e1b.tar.gz gcc-0977ab3aa6121253392b15c02679a86615f05e1b.tar.bz2 |
re PR middle-end/14535 (exception throwing in virtual function doesn't turn on the local destructors)
PR middle-end/14535
* except.c (collect_one_action_chain): Record action for cleanup
outer of exception spec.
* g++.dg/eh/spec7.C: New.
From-SVN: r79521
Diffstat (limited to 'gcc/except.c')
-rw-r--r-- | gcc/except.c | 14 |
1 files changed, 12 insertions, 2 deletions
diff --git a/gcc/except.c b/gcc/except.c index 4e38df2..c739650 100644 --- a/gcc/except.c +++ b/gcc/except.c @@ -3365,8 +3365,18 @@ collect_one_action_chain (htab_t ar_hash, struct eh_region *region) /* An exception specification adds its filter to the beginning of the chain. */ next = collect_one_action_chain (ar_hash, region->outer); - return add_action_record (ar_hash, region->u.allowed.filter, - next < 0 ? 0 : next); + + /* If there is no next action, terminate the chain. */ + if (next == -1) + next = 0; + /* If all outer actions are cleanups or must_not_throw, + we'll have no action record for it, since we had wanted + to encode these states in the call-site record directly. + Add a cleanup action to the chain to catch these. */ + else if (next <= 0) + next = add_action_record (ar_hash, 0, 0); + + return add_action_record (ar_hash, region->u.allowed.filter, next); case ERT_MUST_NOT_THROW: /* A must-not-throw region with no inner handlers or cleanups |