diff options
author | Jaka Mocnik <jaka@xlab.si> | 2009-02-20 12:19:34 +0100 |
---|---|---|
committer | Uros Bizjak <uros@gcc.gnu.org> | 2009-02-20 12:19:34 +0100 |
commit | 5bc0807c06465ee90e63c0b2c3aced1020448708 (patch) | |
tree | 2b8646176623d9cdc73cb719185b58117ac425f0 | |
parent | c69cd1f5cd4256bea42452375dbf67c25bd6e4ef (diff) | |
download | gcc-5bc0807c06465ee90e63c0b2c3aced1020448708.zip gcc-5bc0807c06465ee90e63c0b2c3aced1020448708.tar.gz gcc-5bc0807c06465ee90e63c0b2c3aced1020448708.tar.bz2 |
calls.c (emit_library_call_value_1): Use slot_offset instead of offset when calculating bounds for indexing...
* 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
-rw-r--r-- | gcc/ChangeLog | 6 | ||||
-rw-r--r-- | gcc/calls.c | 4 |
2 files changed, 8 insertions, 2 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog index 755a35b..64bfbe0 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -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 diff --git a/gcc/calls.c b/gcc/calls.c index df7481a..7bad365 100644 --- a/gcc/calls.c +++ b/gcc/calls.c @@ -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 |