[llvm] 437dfa5 - Fix use-after-free in help message: this cl::opt was binding a StringRef to a temporary string

Mehdi Amini via llvm-commits llvm-commits at lists.llvm.org
Mon Apr 10 23:26:31 PDT 2023


Author: Mehdi Amini
Date: 2023-04-11T00:26:15-06:00
New Revision: 437dfa5b0365a7228af00b17b7e0ad6e9a321129

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

LOG: Fix use-after-free in help message: this cl::opt was binding a StringRef to a temporary string

Caught by ASAN on a bot: https://lab.llvm.org/buildbot/#/builders/168/builds/12872/steps/14/logs/stdio

Added: 
    

Modified: 
    llvm/lib/Analysis/MLInlineAdvisor.cpp

Removed: 
    


################################################################################
diff  --git a/llvm/lib/Analysis/MLInlineAdvisor.cpp b/llvm/lib/Analysis/MLInlineAdvisor.cpp
index dcf341c112e5..f97764859538 100644
--- a/llvm/lib/Analysis/MLInlineAdvisor.cpp
+++ b/llvm/lib/Analysis/MLInlineAdvisor.cpp
@@ -41,9 +41,7 @@ static cl::opt<std::string> InteractiveChannelBaseName(
 static cl::opt<bool> InteractiveIncludeDefault(
     "inliner-interactive-include-default", cl::Hidden,
     cl::desc(
-        (Twine("In interactive mode, also send the default policy decision: ") +
-         DefaultDecisionName + ".")
-            .str()));
+        "In interactive mode, also send the default policy decision."));
 
 #if defined(LLVM_HAVE_TF_AOT_INLINERSIZEMODEL)
 // codegen-ed file


        


More information about the llvm-commits mailing list