summaryrefslogtreecommitdiff
path: root/sysdeps/powerpc/powerpc32/backtrace.c
diff options
context:
space:
mode:
Diffstat (limited to 'sysdeps/powerpc/powerpc32/backtrace.c')
-rw-r--r--sysdeps/powerpc/powerpc32/backtrace.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/sysdeps/powerpc/powerpc32/backtrace.c b/sysdeps/powerpc/powerpc32/backtrace.c
index 7c2d4726f8..d1456c8ae4 100644
--- a/sysdeps/powerpc/powerpc32/backtrace.c
+++ b/sysdeps/powerpc/powerpc32/backtrace.c
@@ -114,6 +114,8 @@ __backtrace (void **array, int size)
}
if (gregset)
{
+ if (count + 1 == size)
+ break;
array[++count] = (void*)((*gregset)[PT_NIP]);
current = (void*)((*gregset)[PT_R1]);
}