]> 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:22:35 +0000 (18:22 +0000)
committerEric Botcazou <ebotcazou@gcc.gnu.org>
Mon, 9 Jan 2012 18:22:35 +0000 (18:22 +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: r183022

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

index 6a8595c1d5f23138e768438409960585bb9bd917..66cf0914da4f7a1ff14615224567e990c7ad2346 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-06  Richard Sandiford  <richard.sandiford@linaro.org>
 
        PR middle-end/48660
index aa1358dfae589ab0b5ef023a0f2a19ad344b4df6..6eb070cff5667aada1768b95a42878d80ce704ce 100644 (file)
@@ -123,10 +123,10 @@ sparc64_fallback_frame_state (struct _Unwind_Context *context,
          /* 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 *)(this_cfa + 176 + 15*8) - 4);
+         unsigned long sah_address
+           = *(unsigned long *)(this_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.  */
            regs_off = 176 + 176 + 176 + 304;
          else
@@ -371,10 +371,10 @@ sparc_fallback_frame_state (struct _Unwind_Context *context,
          /* 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 *)(this_cfa + 96 + 15*4) - 4);
+         unsigned int sah_address
+           = *(unsigned int *)(this_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.  */
            regs_off = 96 + 96 + 96 + 160;
          else