[llvm] 2700d0d - [AAUnderlyingObjects] Initialize an uninitialized boolean.

Caroline Tice via llvm-commits llvm-commits at lists.llvm.org
Mon Jan 9 15:46:53 PST 2023


Author: Caroline Tice
Date: 2023-01-09T15:46:15-08:00
New Revision: 2700d0d13ac28895b7271f81895ef60a7a5ebab6

URL: https://github.com/llvm/llvm-project/commit/2700d0d13ac28895b7271f81895ef60a7a5ebab6
DIFF: https://github.com/llvm/llvm-project/commit/2700d0d13ac28895b7271f81895ef60a7a5ebab6.diff

LOG: [AAUnderlyingObjects] Initialize an uninitialized boolean.

Recent commit introducing AA for getting underluying objects of a
pointer created an uninitialized boolean, which causes tests to fail
when built unter asan/ubsan. This initialized that variable.

Added: 
    

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

Removed: 
    


################################################################################
diff  --git a/llvm/lib/Transforms/IPO/AttributorAttributes.cpp b/llvm/lib/Transforms/IPO/AttributorAttributes.cpp
index 9c67a0015f86d..00c1c3e44788f 100644
--- a/llvm/lib/Transforms/IPO/AttributorAttributes.cpp
+++ b/llvm/lib/Transforms/IPO/AttributorAttributes.cpp
@@ -11228,7 +11228,7 @@ struct AAUnderlyingObjectsImpl
 
     auto DoUpdate = [&](SmallSetVector<Value *, 8> &UnderlyingObjects,
                         AA::ValueScope Scope) {
-      bool UsedAssumedInformation;
+      bool UsedAssumedInformation = false;
       SmallPtrSet<Value *, 8> SeenObjects;
       SmallVector<AA::ValueAndContext> Values;
 


        


More information about the llvm-commits mailing list