about summary refs log tree commit diff
path: root/sysdeps/microblaze/backtrace.c
diff options
context:
space:
mode:
Diffstat (limited to 'sysdeps/microblaze/backtrace.c')
-rw-r--r--sysdeps/microblaze/backtrace.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/sysdeps/microblaze/backtrace.c b/sysdeps/microblaze/backtrace.c
index 24e827ac39..c043ba7681 100644
--- a/sysdeps/microblaze/backtrace.c
+++ b/sysdeps/microblaze/backtrace.c
@@ -114,6 +114,9 @@ __backtrace (void **array, int size)
   int count;
   int rc = 0;
 
+  if (size <= 0)
+    return 0;
+
   __asm__ __volatile__ ("mfs %0, rpc"
                         : "=r"(pc));