mirror of
https://github.com/gnustep/libs-base.git
synced 2025-05-31 16:50:58 +00:00
Fix size of buffer for backtrace
This commit is contained in:
parent
f15eb90b8a
commit
8dbb7ea40a
1 changed files with 15 additions and 10 deletions
|
@ -595,10 +595,15 @@ GSUnwindCallback(struct _Unwind_Context* context, void* arg)
|
|||
{
|
||||
struct GSBacktraceState *state = (struct GSBacktraceState*)arg;
|
||||
uintptr_t pc = _Unwind_GetIP(context);
|
||||
if (pc) {
|
||||
if (state->current == state->end) {
|
||||
|
||||
if (pc)
|
||||
{
|
||||
if (state->current == state->end)
|
||||
{
|
||||
return _URC_END_OF_STACK;
|
||||
} else {
|
||||
}
|
||||
else
|
||||
{
|
||||
*state->current++ = (void*)pc;
|
||||
}
|
||||
}
|
||||
|
@ -994,7 +999,7 @@ GSPrivateReturnAddresses(NSUInteger **returns)
|
|||
GS_MUTEX_UNLOCK(traceLock);
|
||||
|
||||
#elif defined(HAVE_BACKTRACE)
|
||||
void *addr[MAXFRAMES*sizeof(NSUInteger)];
|
||||
void *addr[MAXFRAMES];
|
||||
|
||||
numReturns = backtrace(addr, MAXFRAMES);
|
||||
if (numReturns > 0)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue