Fix in getAllocationDataForFunction
authorDavid Chisnall <csdavec@swan.ac.uk>
Tue, 28 Aug 2018 08:59:06 +0000 (08:59 +0000)
committerDavid Chisnall <csdavec@swan.ac.uk>
Tue, 28 Aug 2018 08:59:06 +0000 (08:59 +0000)
Summary:
Correct to use set like behaviour of AllocType.  Should check for
subset, not precise value.

Reviewers: theraven

Reviewed By: theraven

Subscribers: hiraditya, llvm-commits

Differential Revision: https://reviews.llvm.org/D50959

llvm-svn: 340807

llvm/lib/Analysis/MemoryBuiltins.cpp

index 686ad29..e93021b 100644 (file)
@@ -150,7 +150,7 @@ getAllocationDataForFunction(const Function *Callee, AllocType AllocTy,
     return None;
 
   const AllocFnsTy *FnData = &Iter->second;
-  if ((FnData->AllocTy & AllocTy) != FnData->AllocTy)
+  if ((FnData->AllocTy & AllocTy) == 0)
     return None;
 
   // Check function prototype.