From: Scott Michel Date: Sat, 22 Nov 2008 23:49:26 +0000 (+0000) Subject: Check for NULL before traversing the isa<> type hierarchy checking with a X-Git-Url: http://plrg.eecs.uci.edu/git/?a=commitdiff_plain;h=bab6436b1726a2db21ab1e024540e98c02a5a009;p=oota-llvm.git 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 --- diff --git a/include/llvm/Support/Casting.h b/include/llvm/Support/Casting.h index 48988f8a6bb..c441626216f 100644 --- a/include/llvm/Support/Casting.h +++ b/include/llvm/Support/Casting.h @@ -98,7 +98,7 @@ template struct isa_impl_cl { template static bool isa(FromCl *Val) { - return isa_impl_cl::template isa(*Val); + return (Val != 0 && isa_impl_cl::template isa(*Val)); } };