libffi err_bad_typedef.c fix

Dave Korn dave.korn.cygwin@googlemail.com
Wed Sep 2 00:18:00 GMT 2009


[ libffi-discuss added to Cc line, re:
  http://gcc.gnu.org/ml/gcc-patches/2009-09/msg00089.html  ]

Duncan Simpson wrote:
> The err_bad_typedef fails due to a null pointer deference on
> my athlon 64 system. The attached patch notices that the pointer
> is NULL and returns ERR_BAD_TYPEDEF instead of dereferencing it.
> 
> This fixes the err_bad_typedef.c execution tests. I have left
> them as expected failures for the moment. I believe the bug
> is ABI independent.

  Is it the right fix, or is the real bug that the pointer is getting munged
in passing somehow and it's not supposed to be NULL?  If it were the latter,
I'm not sure there's a lot of point in both papering over the cracks /and/
XFAILing something; it might make it less likely if anyone ever comes back to
it that they'll even realise there ever was a bug to be found, mightn't it?

    cheers,
      DaveK



More information about the Gcc-patches mailing list