Author: Alex Brachet
Date: 2023-02-10T22:42:12Z
New Revision: 043550e33509fb3179cfcd6516e8d93240553582

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

LOG: [Driver] Stop stack use after free

In reality this would have always been fine because main's
stack frame will always be live when another thread is
executing the cc1_reproducer_main. But ASan and HWASan
were upset

Added: 
    

Modified: 
    clang/tools/driver/driver.cpp

Removed: 
    


################################################################################
diff  --git a/clang/tools/driver/driver.cpp b/clang/tools/driver/driver.cpp
index 52d391fc6971..3ec2bcc0bd75 100644
--- a/clang/tools/driver/driver.cpp
+++ b/clang/tools/driver/driver.cpp
@@ -537,7 +537,7 @@ int clang_main(int Argc, char **Argv, const 
llvm::ToolContext &ToolContext) {
     return 1;
 
   if (!UseNewCC1Process) {
-    TheDriver.CC1Main = [&ToolContext](SmallVectorImpl<const char *> &ArgV) {
+    TheDriver.CC1Main = [ToolContext](SmallVectorImpl<const char *> &ArgV) {
       return ExecuteCC1Tool(ArgV, ToolContext);
     };
     // Ensure the CC1Command actually catches cc1 crashes


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

Reply via email to