[llvm] 9b6b9d3 - Default initialize a pointer in CodeExtractor.

Haojian Wu via llvm-commits llvm-commits at lists.llvm.org
Thu Nov 14 02:38:23 PST 2024


Author: Haojian Wu
Date: 2024-11-14T11:38:02+01:00
New Revision: 9b6b9d39030f92ea20d8f38ef37305e99cfc6d60

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

LOG: Default initialize a pointer in CodeExtractor.

This fixes msan failure after f6795e6b4f619cbecc59a92f7e5fad7ca90ece54

Added: 
    

Modified: 
    llvm/lib/Transforms/Utils/CodeExtractor.cpp

Removed: 
    


################################################################################
diff  --git a/llvm/lib/Transforms/Utils/CodeExtractor.cpp b/llvm/lib/Transforms/Utils/CodeExtractor.cpp
index ed4c9c3c30f4f3..6539f924c2edf4 100644
--- a/llvm/lib/Transforms/Utils/CodeExtractor.cpp
+++ b/llvm/lib/Transforms/Utils/CodeExtractor.cpp
@@ -1465,7 +1465,7 @@ CodeExtractor::extractCodeRegion(const CodeExtractorAnalysisCache &CEAC,
           : Suffix;
 
   ValueSet StructValues;
-  StructType *StructTy;
+  StructType *StructTy = nullptr;
   Function *newFunction = constructFunctionDeclaration(
       inputs, outputs, EntryFreq, oldFunction->getName() + "." + SuffixToUse,
       StructValues, StructTy);


        


More information about the llvm-commits mailing list