Really, really fix PointerUnion3::is
authorDouglas Gregor <dgregor@apple.com>
Tue, 31 Mar 2009 00:34:31 +0000 (00:34 +0000)
committerDouglas Gregor <dgregor@apple.com>
Tue, 31 Mar 2009 00:34:31 +0000 (00:34 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@68079 91177308-0d34-0410-b5e6-96231b3b80d8

include/llvm/ADT/PointerUnion.h

index 43f5e09cf9e316d00e527f76323ee25c816c2c41..0737000c47c0f95d959d1d45fe53b376e4a52490 100644 (file)
@@ -182,7 +182,7 @@ namespace llvm {
     int is() const {
       // Is it PT1/PT2?
       if (::llvm::getPointerUnionTypeNum<PT1, PT2>((T*)0) != -1)
-        return Val.get<InnerUnion>().is<T>();
+        return Val.is<InnerUnion>() && Val.get<InnerUnion>().is<T>();
       // Must be PT3 or statically invalid.
       assert(Val.is<T>());
       return true;