[llvm] d62bbbe - [Attributor] Initialize effectively unused value to appease UBSAN

Johannes Doerfert via llvm-commits llvm-commits at lists.llvm.org
Tue Jul 20 07:19:01 PDT 2021


Author: Johannes Doerfert
Date: 2021-07-20T09:18:51-05:00
New Revision: d62bbbebbf709b1eaebaace62c58e759cbd32005

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

LOG: [Attributor] Initialize effectively unused value to appease UBSAN

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 91f57a84fd1e..98bce21cf965 100644
--- a/llvm/lib/Transforms/IPO/AttributorAttributes.cpp
+++ b/llvm/lib/Transforms/IPO/AttributorAttributes.cpp
@@ -5144,7 +5144,7 @@ struct AAValueSimplifyImpl : AAValueSimplify {
       if (isa<ConstantPointerNull>(Obj)) {
         // A null pointer access can be undefined but any offset from null may
         // be OK. We do not try to optimize the latter.
-        bool UsedAssumedInformation;
+        bool UsedAssumedInformation = false;
         if (!NullPointerIsDefined(L.getFunction(),
                                   Ptr.getType()->getPointerAddressSpace()) &&
             A.getAssumedSimplified(Ptr, AA, UsedAssumedInformation) == Obj)


        


More information about the llvm-commits mailing list