From: Jaka Mocnik Date: Fri, 20 Feb 2009 11:19:34 +0000 (+0100) Subject: calls.c (emit_library_call_value_1): Use slot_offset instead of offset when calculati... X-Git-Tag: releases/gcc-4.4.0~484 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=5bc0807c06465ee90e63c0b2c3aced1020448708;p=thirdparty%2Fgcc.git 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 --- diff --git a/gcc/ChangeLog b/gcc/ChangeLog index 755a35b4648a..64bfbe062965 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,9 @@ +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 Jakub Jelinek PR target/39240 diff --git a/gcc/calls.c b/gcc/calls.c index df7481ab4de2..7bad365b5ac7 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