Use stripPointerCasts(). Thanks Duncan!
authorDan Gohman <gohman@apple.com>
Fri, 20 Nov 2009 19:33:16 +0000 (19:33 +0000)
committerDan Gohman <gohman@apple.com>
Fri, 20 Nov 2009 19:33:16 +0000 (19:33 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@89472 91177308-0d34-0410-b5e6-96231b3b80d8

lib/Analysis/CaptureTracking.cpp

index 8364d81497c2f5b9af1190cb0909f388ddedce26..a276c64c9a44f86e8fba9fcf47e7715983f6a2db 100644 (file)
@@ -109,7 +109,7 @@ bool llvm::PointerMayBeCaptured(const Value *V,
       // Don't count comparisons of a no-alias return value against null as
       // captures. This allows us to ignore comparisons of malloc results
       // with null, for example.
-      if (isNoAliasCall(V))
+      if (isNoAliasCall(V->stripPointerCasts()))
         if (ConstantPointerNull *CPN =
               dyn_cast<ConstantPointerNull>(I->getOperand(1)))
           if (CPN->getType()->getAddressSpace() == 0)