[PATCH] D108170: [Attributor][FIX] AAPointerInfo fix uninitialized usage.

Kuter Dinel via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon Aug 16 16:31:09 PDT 2021


kuter created this revision.
Herald added subscribers: ormris, okura, jdoerfert, uenoku, hiraditya.
Herald added a reviewer: uenoku.
Herald added a reviewer: homerdin.
kuter requested review of this revision.
Herald added a reviewer: jdoerfert.
Herald added a reviewer: sstefan1.
Herald added a reviewer: baziotis.
Herald added a project: LLVM.
Herald added a subscriber: llvm-commits.

Valgrind complains about AAPoineterInfo::handleAccess branching
on a uninitialized variable. This patch fixes the problem.


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D108170

Files:
  llvm/lib/Transforms/IPO/AttributorAttributes.cpp


Index: llvm/lib/Transforms/IPO/AttributorAttributes.cpp
===================================================================
--- llvm/lib/Transforms/IPO/AttributorAttributes.cpp
+++ llvm/lib/Transforms/IPO/AttributorAttributes.cpp
@@ -1383,7 +1383,7 @@
         LengthVal = Length->getSExtValue();
       Value &Ptr = getAssociatedValue();
       unsigned ArgNo = getIRPosition().getCallSiteArgNo();
-      ChangeStatus Changed;
+      ChangeStatus Changed = ChangeStatus::UNCHANGED;
       if (ArgNo == 0) {
         handleAccess(A, *MI, Ptr, nullptr, AccessKind::AK_WRITE, 0, Changed,
                      nullptr, LengthVal);


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D108170.366764.patch
Type: text/x-patch
Size: 629 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20210816/411f7675/attachment-0001.bin>


More information about the llvm-commits mailing list