[git commit prelink] bfin: fix fp reference in _JMPBUF_UNWINDS

Mike Frysinger vapier at gentoo.org
Wed Mar 30 11:53:36 UTC 2011

commit: http://git.uclibc.org/uClibc/commit/?id=9112a2398ec58b32cd1a1c6feae195bd8f9a46a2
branch: http://git.uclibc.org/uClibc/commit/?id=refs/heads/prelink

We want to access the frame pointer, so do so directly rather than
"overflowing" the pregs array and ending up at the fp member.

This fixes the Blackfin build warnings:
libpthread/linuxthreads.old/ptlongjmp.c: In function 'pthread_cleanup_upto':
libpthread/linuxthreads.old/ptlongjmp.c:35: warning: array subscript is above array bounds
libpthread/linuxthreads.old/ptlongjmp.c:56: warning: array subscript is above array bounds

Signed-off-by: Mike Frysinger <vapier at gentoo.org>
 libc/sysdeps/linux/bfin/bits/setjmp.h |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/libc/sysdeps/linux/bfin/bits/setjmp.h b/libc/sysdeps/linux/bfin/bits/setjmp.h
index ee3f5e7..adb9c23 100644
--- a/libc/sysdeps/linux/bfin/bits/setjmp.h
+++ b/libc/sysdeps/linux/bfin/bits/setjmp.h
@@ -52,6 +52,6 @@ typedef struct
 /* Test if longjmp to JMPBUF would unwind the frame
    containing a local variable at ADDRESS.  */
 #define _JMPBUF_UNWINDS(jmpbuf, address) \
-  ((void *) (address) < (void *) (jmpbuf)->__pregs[6])
+  ((void *) (address) < (void *) (jmpbuf)->fp)
 #endif	/* bits/setjmp.h */

More information about the uClibc-cvs mailing list