base: avoid compiler warning in Thread::stack_top

The statement _context->stack[-1] triggered the compiler warning
'array subscript is below array bounds'.

ref #989
This commit is contained in:
Martin Stein 2013-12-05 11:19:00 +01:00 committed by Norman Feske
parent a596bfe797
commit 750f5313f7

View File

@ -335,7 +335,11 @@ namespace Genode {
*
* \return pointer to first stack element
*/
void *stack_top() { return &_context->stack[-1]; }
void *stack_top()
{
return (void *)((addr_t)_context->stack -
sizeof(_context->stack[0]));
}
/**
* Return base of stack