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.

llvm-svn: 59890
This commit is contained in:
Scott Michel 2008-11-22 23:49:26 +00:00
parent b5712a8ba9
commit 0da772db1c

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));
}
};