Author: Fangrui Song
Date: 2023-02-06T12:54:34-08:00
New Revision: 6ab9f1e59371fe96ca3fda1a26a28ae0b7caf637

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

LOG: [Driver] Fix -fsanitize-address-stack-use-after-scope after D142606

Driver::getToolChain called by Driver::BuildCompilation gets the
`Triple` argument from a temporary. With delayed detection due to
LazyDetector, we would reference a dangling `Triple`.

Added: 
    

Modified: 
    clang/lib/Driver/ToolChains/LazyDetector.h

Removed: 
    


################################################################################
diff  --git a/clang/lib/Driver/ToolChains/LazyDetector.h 
b/clang/lib/Driver/ToolChains/LazyDetector.h
index dfa8b5a4a82e4..813d00a87bb88 100644
--- a/clang/lib/Driver/ToolChains/LazyDetector.h
+++ b/clang/lib/Driver/ToolChains/LazyDetector.h
@@ -20,7 +20,7 @@ namespace clang {
 
 template <class T> class LazyDetector {
   const driver::Driver &D;
-  const llvm::Triple &Triple;
+  llvm::Triple Triple;
   const llvm::opt::ArgList &Args;
 
   std::optional<T> Detector;


        
_______________________________________________
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

Reply via email to