Commit 5bc0807c by Jaka Mocnik Committed by Uros Bizjak

calls.c (emit_library_call_value_1): Use slot_offset instead of offset when…

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
parent c69cd1f5
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> 2009-02-20 Jakub Jelinek <jakub@redhat.com>
PR target/39240 PR target/39240
......
...@@ -3646,10 +3646,10 @@ emit_library_call_value_1 (int retval, rtx orgfun, rtx value, ...@@ -3646,10 +3646,10 @@ emit_library_call_value_1 (int retval, rtx orgfun, rtx value,
#ifdef ARGS_GROW_DOWNWARD #ifdef ARGS_GROW_DOWNWARD
/* stack_slot is negative, but we want to index stack_usage_map /* stack_slot is negative, but we want to index stack_usage_map
with positive values. */ 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; lower_bound = upper_bound - argvec[argnum].locate.size.constant;
#else #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; upper_bound = lower_bound + argvec[argnum].locate.size.constant;
#endif #endif
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment