]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
sol2-unwind.h (sparc64_is_sighandler): Check that the purported sigacthandler address...
authorEric Botcazou <ebotcazou@adacore.com>
Mon, 9 Jan 2012 18:20:55 +0000 (18:20 +0000)
committerEric Botcazou <ebotcazou@gcc.gnu.org>
Mon, 9 Jan 2012 18:20:55 +0000 (18:20 +0000)
* config/sparc/sol2-unwind.h (sparc64_is_sighandler): Check that the
purported sigacthandler address isn't null before dereferencing it.
(sparc_is_sighandler): Likewise.

From-SVN: r183020

libgcc/ChangeLog
libgcc/config/sparc/sol2-unwind.h

index 3f23e724b97c808a1d2cf6ceee66dbcf1d300c54..778848ba5bc058c09efd174e2a73ef4085851b3f 100644 (file)
@@ -1,3 +1,9 @@
+2012-01-09  Eric Botcazou  <ebotcazou@adacore.com>
+
+       * config/sparc/sol2-unwind.h (sparc64_is_sighandler): Check that the
+       purported sigacthandler address isn't null before dereferencing it.
+       (sparc_is_sighandler): Likewise.
+
 2012-01-09  Eric Botcazou  <ebotcazou@adacore.com>
 
        PR ada/41929
index ea4c541b8159da260bd493548874fddb454fb6ce..7d6bd221dd51dc280cbacb8a72776aa6de9df13a 100644 (file)
@@ -124,10 +124,9 @@ sparc64_is_sighandler (unsigned int *pc, void *cfa, int *nframes)
          /* This matches the call_user_handler pattern for Solaris 10.
             There are 2 cases so we look for the return address of the
             caller's caller frame in order to do more pattern matching.  */
-         unsigned int sah_pattern
-           = *(unsigned int *)(*(unsigned long *)(cfa + 176 + 15*8) - 4);
+         unsigned long sah_address = *(unsigned long *)(cfa + 176 + 15*8);
 
-          if (sah_pattern == 0x92100019)
+          if (sah_address && *(unsigned int *)(sah_address - 4) == 0x92100019)
            /* This is the same setup as for Solaris 9, see below.  */
            *nframes = 3;
          else
@@ -302,10 +301,9 @@ sparc_is_sighandler (unsigned int *pc, void *cfa, int *nframes)
          /* This matches the call_user_handler pattern for Solaris 10.
             There are 2 cases so we look for the return address of the
             caller's caller frame in order to do more pattern matching.  */
-         unsigned int sah_pattern
-           = *(unsigned int *)(*(unsigned int *)(cfa + 96 + 15*4) - 4);
+         unsigned int sah_address = *(unsigned int *)(cfa + 96 + 15*4);
 
-          if (sah_pattern == 0x92100019)
+          if (sah_address && *(unsigned int *)(sah_address - 4) == 0x92100019)
            /* This is the same setup as for Solaris 9, see below.  */
            *nframes = 3;
          else