public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
* [Ada] Do not catch exception if _UA_FORCE_UNWIND flag is set.
@ 2011-08-30 15:05 Arnaud Charlet
  0 siblings, 0 replies; only message in thread
From: Arnaud Charlet @ 2011-08-30 15:05 UTC (permalink / raw)
  To: gcc-patches; +Cc: Tristan Gingold

[-- Attachment #1: Type: text/plain, Size: 271 bytes --]

Fix a non-compliance with the unwind ABI.
No pure Ada testcase.

Tested on x86_64-pc-linux-gnu, committed on trunk

2011-08-30  Tristan Gingold  <gingold@adacore.com>

	* raise-gcc.c: Never catch exception if _UA_FORCE_UNWIND flag is set,
	to be compliant with the ABI.


[-- Attachment #2: difs --]
[-- Type: text/plain, Size: 2395 bytes --]

Index: raise-gcc.c
===================================================================
--- raise-gcc.c	(revision 178293)
+++ raise-gcc.c	(working copy)
@@ -217,7 +217,7 @@
 static void
 db_phases (int phases)
 {
-  phase_descriptor *a = phase_descriptors;
+  const phase_descriptor *a = phase_descriptors;
 
   if (! (db_accepted_codes() & DB_PHASES))
     return;
@@ -901,6 +901,7 @@
 static void
 get_action_description_for (_Unwind_Context *uw_context,
                             _Unwind_Exception *uw_exception,
+                            _Unwind_Action uw_phase,
                             region_descriptor *region,
                             action_descriptor *action)
 {
@@ -965,17 +966,22 @@
 	  /* Positive filters are for regular handlers.  */
 	  else if (ar_filter > 0)
 	    {
-	      /* See if the filter we have is for an exception which matches
-		 the one we are propagating.  */
-	      _Unwind_Ptr choice = get_ttype_entry_for (region, ar_filter);
+              /* Do not catch an exception if the _UA_FORCE_UNWIND flag is
+                 passed (to follow the ABI).  */
+              if (!(uw_phase & _UA_FORCE_UNWIND))
+                {
+                  /* See if the filter we have is for an exception which
+                     matches the one we are propagating.  */
+                  _Unwind_Ptr choice = get_ttype_entry_for (region, ar_filter);
 
-	      if (is_handled_by (choice, gnat_exception))
-		{
-		  action->kind = handler;
-		  action->ttype_filter = ar_filter;
-		  action->ttype_entry = choice;
-		  return;
-		}
+                  if (is_handled_by (choice, gnat_exception))
+                    {
+                      action->kind = handler;
+                      action->ttype_filter = ar_filter;
+                      action->ttype_entry = choice;
+                      return;
+                    }
+                }
 	    }
 
 	  /* Negative filter values are for C++ exception specifications.
@@ -1128,7 +1134,8 @@
 
   /* Search the call-site and action-record tables for the action associated
      with this IP.  */
-  get_action_description_for (uw_context, uw_exception, &region, &action);
+  get_action_description_for (uw_context, uw_exception, uw_phases,
+                              &region, &action);
   db_action_for (&action, uw_context);
 
   /* Whatever the phase, if there is nothing relevant in this frame,

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2011-08-30 14:02 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2011-08-30 15:05 [Ada] Do not catch exception if _UA_FORCE_UNWIND flag is set Arnaud Charlet

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).