[PATCH] D89885: [MemLoc] Adjust memccpy support in MemoryLocation::getForArgument

Dávid Bolvanský via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed Oct 28 09:31:26 PDT 2020


xbolva00 updated this revision to Diff 301313.

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D89885/new/

https://reviews.llvm.org/D89885

Files:
  llvm/lib/Analysis/MemoryLocation.cpp


Index: llvm/lib/Analysis/MemoryLocation.cpp
===================================================================
--- llvm/lib/Analysis/MemoryLocation.cpp
+++ llvm/lib/Analysis/MemoryLocation.cpp
@@ -257,10 +257,11 @@
     case LibFunc_memccpy:
       assert((ArgIdx == 0 || ArgIdx == 1) &&
              "Invalid argument index for memccpy");
+      // We only know an upper bound on the number of bytes read/written.
       if (const ConstantInt *LenCI =
               dyn_cast<ConstantInt>(Call->getArgOperand(3)))
-        return MemoryLocation(Arg, LocationSize::precise(LenCI->getZExtValue()),
-                              AATags);
+        return MemoryLocation(
+            Arg, LocationSize::upperBound(LenCI->getZExtValue()), AATags);
       break;
     default:
       break;


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D89885.301313.patch
Type: text/x-patch
Size: 789 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20201028/0822f6bd/attachment.bin>


More information about the llvm-commits mailing list