This is the mail archive of the
libc-alpha@sourceware.org
mailing list for the glibc project.
Re: [Patch][BZ 14594] Demangle function pointers before testing them
- From: Jeff Law <law at redhat dot com>
- To: Andreas Schwab <schwab at linux-m68k dot org>
- Cc: libc-alpha <libc-alpha at sourceware dot org>
- Date: Thu, 20 Sep 2012 16:07:49 -0600
- Subject: Re: [Patch][BZ 14594] Demangle function pointers before testing them
- References: <505B88BC.9010503@redhat.com> <m2r4pws6zh.fsf@igel.home>
On 09/20/2012 03:46 PM, Andreas Schwab wrote:
Jeff Law <law@redhat.com> writes:
The problem is find_module tests the *mangled* pointer against NULL;
Which is correct, since the NULL pointer is never mangled.
Huh? I think you're misunderstood something Andreas.
The intent of the code is to not use the function pointer for an
indirect call if the clear pointer (to use Rich's term) is null. That
makes perfect sense.
The problem is the code is testing the mangled pointer against null
which is blatently wrong -- unless you can always guarantee that the
mangling will never produce a zero result given a nonzero input.
jeff