]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
calls.c (emit_library_call_value_1): Use slot_offset instead of offset when calculati...
authorJaka Mocnik <jaka@xlab.si>
Fri, 20 Feb 2009 11:19:34 +0000 (12:19 +0100)
committerUros Bizjak <uros@gcc.gnu.org>
Fri, 20 Feb 2009 11:19:34 +0000 (12:19 +0100)
* calls.c (emit_library_call_value_1): Use slot_offset instead of
offset when calculating bounds for indexing stack_usage_map.  Fixes
a buffer overflow with certain target setups.

From-SVN: r144317

gcc/ChangeLog
gcc/calls.c

index 755a35b4648a7c435ebef432fa3c65d98054a0fc..64bfbe0629656d052ea18ac3350a92722b54e3ba 100644 (file)
@@ -1,3 +1,9 @@
+2009-02-20  Jaka Mocnik  <jaka@xlab.si>
+
+       * calls.c (emit_library_call_value_1): Use slot_offset instead of
+       offset when calculating bounds for indexing stack_usage_map.  Fixes
+       a buffer overflow with certain target setups.
+
 2009-02-20  Jakub Jelinek  <jakub@redhat.com>
 
        PR target/39240
index df7481ab4de2fc98d9240e9b38a8fc2f542096ac..7bad365b5ac72a450a0e518607c48617d23d06ef 100644 (file)
@@ -3646,10 +3646,10 @@ emit_library_call_value_1 (int retval, rtx orgfun, rtx value,
 #ifdef ARGS_GROW_DOWNWARD
              /* stack_slot is negative, but we want to index stack_usage_map
                 with positive values.  */
-             upper_bound = -argvec[argnum].locate.offset.constant + 1;
+             upper_bound = -argvec[argnum].locate.slot_offset.constant + 1;
              lower_bound = upper_bound - argvec[argnum].locate.size.constant;
 #else
-             lower_bound = argvec[argnum].locate.offset.constant;
+             lower_bound = argvec[argnum].locate.slot_offset.constant;
              upper_bound = lower_bound + argvec[argnum].locate.size.constant;
 #endif