From: Uros Bizjak Date: Sat, 21 Feb 2009 11:08:24 +0000 (+0100) Subject: backport: calls.c (emit_library_call_value_1): Use slot_offset instead of offset... X-Git-Tag: releases/gcc-4.3.4~315 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=87634b88085baf97e6854e0591c7275b13b7a389;p=thirdparty%2Fgcc.git 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 --- 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