Improper usage of CHECK macros generates unreachable code
Tom Rodriguez
Thomas.Rodriguez at Sun.COM
Wed Oct 7 09:33:16 PDT 2009
> My impression is that just replacing CHECK with THREAD would work
> because usually the caller of the method which does the call with the
> CHECK macro also checks for pending exception such that invalid return
> values do no harm. At least this is my only explanation for why this
> has not lead to any serious problems until now.
If all the places where this happens are for allocation then it's
because they will always return null if an exception is thrown. I
you're calling something that uses CHECK_NULL then the return value
will already agree with HAS_PENDING_EXCEPTION.
> But personally I would vote for the much cleaner solution with the
> temporary variable because it's not more overhead and there's still a
> small chance to catch some undiscovered errors.
I believe this is the right solution as well.
tom
>
> Regards,
> Volker
>
>>
>> -- Christian
>>
>>
More information about the hotspot-dev
mailing list