diff options
author | Paul Pluzhnikov <ppluzhnikov@google.com> | 2015-08-15 11:42:43 -0700 |
---|---|---|
committer | Paul Pluzhnikov <ppluzhnikov@google.com> | 2015-08-15 11:42:43 -0700 |
commit | d5dff793af80b6534e9fb2e4f0301993bd209a4f (patch) | |
tree | c3df534ffb1c966cb96ac71fee5cc0c4f17d3d57 /sysdeps/microblaze/backtrace.c | |
parent | 3cda1b6d56335a101ec3de0053248f68f010eee1 (diff) | |
download | glibc-d5dff793af80b6534e9fb2e4f0301993bd209a4f.tar.gz glibc-d5dff793af80b6534e9fb2e4f0301993bd209a4f.tar.xz glibc-d5dff793af80b6534e9fb2e4f0301993bd209a4f.zip |
Fix BZ #18084 -- backtrace (..., 0) dumps core on x86.
Other architectures also had bugs, or did unnecessary work.
Diffstat (limited to 'sysdeps/microblaze/backtrace.c')
-rw-r--r-- | sysdeps/microblaze/backtrace.c | 3 |
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)); |