From 87634b88085baf97e6854e0591c7275b13b7a389 Mon Sep 17 00:00:00 2001 From: Uros Bizjak Date: Sat, 21 Feb 2009 12:08:24 +0100 Subject: [PATCH] backport: calls.c (emit_library_call_value_1): Use slot_offset instead of offset when calculating bounds for indexing... Backport from mainline: 2009-02-20 Jaka Mocnik * 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 | 9 +++++++++ gcc/calls.c | 4 ++-- 2 files changed, 11 insertions(+), 2 deletions(-) diff --git a/gcc/ChangeLog b/gcc/ChangeLog index 2f995930002b..ede8715f3e81 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,12 @@ +2009-02-21 Uros Bizjak + + Backport from mainline: + 2009-02-20 Jaka Mocnik + + * 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 PR target/38056 diff --git a/gcc/calls.c b/gcc/calls.c index 4651d3adc93c..a9554a6c223c 100644 --- a/gcc/calls.c +++ b/gcc/calls.c @@ -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 -- 2.47.2