mirror of
https://github.com/genodelabs/genode.git
synced 2025-05-29 13:44:26 +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
|
* \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
|
* Return base of stack
|
||||||
|
Loading…
x
Reference in New Issue
Block a user