]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
backport: calls.c (emit_library_call_value_1): Use slot_offset instead of offset...
authorUros Bizjak <ubizjak@gmail.com>
Sat, 21 Feb 2009 11:08:24 +0000 (12:08 +0100)
committerUros Bizjak <uros@gcc.gnu.org>
Sat, 21 Feb 2009 11:08:24 +0000 (12:08 +0100)
Backport from mainline:
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.

From-SVN: r144350

gcc/ChangeLog
gcc/calls.c

index 2f995930002b9ed99c1b2cceef4408de22472f89..ede8715f3e81df432072765e1ce191599baa84f3 100644 (file)
@@ -1,3 +1,12 @@
+2009-02-21  Uros Bizjak  <ubizjak@gmail.com>
+
+       Backport from mainline:
+       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  Steve Ellcey  <sje@cup.hp.com>
 
        PR target/38056
index 4651d3adc93c2ca89dd5c4b937faee796d809356..a9554a6c223ce89a5fbc6a4750ba796077930af8 100644 (file)
@@ -3677,10 +3677,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