Skip to content

Commit

Permalink
[Driver] Fix -fsanitize-address-stack-use-after-scope after D142606
Browse files Browse the repository at this point in the history
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`.
  • Loading branch information
MaskRay committed Feb 6, 2023
1 parent abbd256 commit 6ab9f1e
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion clang/lib/Driver/ToolChains/LazyDetector.h
Expand Up @@ -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;
Expand Down

0 comments on commit 6ab9f1e

Please sign in to comment.