mirror of
https://github.com/genodelabs/genode.git
synced 2024-12-23 15:32:25 +00:00
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:
parent
a596bfe797
commit
750f5313f7
@ -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
|
||||
|
Loading…
Reference in New Issue
Block a user