Check for NULL before traversing the isa<> type hierarchy checking with a

NULL-based reference.

Note: Encountered this a few times on Tiger + gcc 4.0.1. Might just be a
platform-specific compiler issue, but it's good defensive programming in any
case.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@59890 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
Scott Michel 2008-11-22 23:49:26 +00:00
parent 7a15273892
commit bab6436b17

View File

@ -98,7 +98,7 @@ template<class FromCl>
struct isa_impl_cl<FromCl*> {
template<class ToCl>
static bool isa(FromCl *Val) {
return isa_impl_cl<FromCl>::template isa<ToCl>(*Val);
return (Val != 0 && isa_impl_cl<FromCl>::template isa<ToCl>(*Val));
}
};