This is the mail archive of the libc-alpha@sourceware.org mailing list for the glibc project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: update bits/setjmp.h for hppa/m68k/mips/s390/sh


Daniel Jacobowitz <drow@false.org> wrote:
> And a question for Kaz...
> 
>>  /* Test if longjmp to JMPBUF would unwind the frame
>>     containing a local variable at ADDRESS.  */
>>  #define _JMPBUF_UNWINDS(jmpbuf, address) \
>> -  ((void *) (address) < &(jmpbuf)[0].__regs[7])
>> +  ((void *) (address) < (void *) &(jmpbuf)[0].__regs[7])
> 
> Is that & really correct?  I would have expected to compare against the
> value, not the address of a member of the jmp_buf.

Oops.  I thought that it was fixed when Jakub pointed out it in
http://sources.redhat.com/ml/libc-hacker/2003-12/msg00076.html
but clearly I'm wrong and that & must be removed.  I've attached
a patch.  Thanks for catching this.

Regards,
	kaz
--
2005-11-16  Kaz Kojima  <kkojima@rr.iij4u.or.jp>

	* sysdeps/sh/bits/setjmp.h (_JMPBUF_UNWINDS): Remove unnecessary &.

--- ORIG/libc/sysdeps/sh/bits/setjmp.h	2003-04-12 09:55:03.000000000 +0900
+++ LOCAL/libc/sysdeps/sh/bits/setjmp.h	2005-11-16 13:59:35.000000000 +0900
@@ -1,4 +1,4 @@
-/* Copyright (C) 1999, 2000, 2003 Free Software Foundation, Inc.
+/* Copyright (C) 1999, 2000, 2003, 2005 Free Software Foundation, Inc.
    This file is part of the GNU C Library.
 
    The GNU C Library is free software; you can redistribute it and/or
@@ -51,6 +51,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)[0].__regs[7])
+  ((void *) (address) < (void *) (jmpbuf)[0].__regs[7])
 
 #endif  /* bits/setjmp.h */


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]