llvm-project/clang/lib/Tooling
Alexander Kornienko 973fcc25fb Fix use-after-free bug in Tooling.
Summary:
`buildASTFromCodeWithArgs()` was creating a memory buffer referencing a
stack-allocated string.  This diff changes the implementation to copy the code
string into the memory buffer so that said buffer owns the memory.

Patch by Yitzhak Mandelbaum.

Reviewers: alexfh

Reviewed By: alexfh

Subscribers: cfe-commits, EricWF

Differential Revision: https://reviews.llvm.org/D55765

llvm-svn: 350638
2019-01-08 16:55:13 +00:00
..
ASTDiff Use llvm::{all,any,none}_of instead std::{all,any,none}_of. NFC 2018-10-20 17:53:42 +00:00
Core clang::tooling::Diagnostic: Don't store offset in the scratch space. 2018-11-21 01:08:46 +00:00
Inclusions NFC: Remove the ObjC1/ObjC2 distinction from clang (and related projects) 2018-10-30 20:31:30 +00:00
Refactoring PR40096: Forwards-compatible with C++20 rule regarding aggregates not having user-declared ctors 2018-12-19 19:33:35 +00:00
AllTUsExecution.cpp [Tooling] Correct the total number of files being processed when `filter` is provided. 2018-11-05 15:08:00 +00:00
ArgumentsAdjusters.cpp [Tooling] Fix some Clang-tidy modernize and Include What You Use warnings; other minor fixes (NFC). 2018-03-14 21:05:51 +00:00
CMakeLists.txt Add explicit dependency on clangSerialization for a bunch of components to fix -DBUILD_SHARED_LIBS=on build 2018-12-12 08:02:18 +00:00
CommonOptionsParser.cpp [Tooling] A new framework for executing clang frontend actions. 2017-10-26 10:38:14 +00:00
CompilationDatabase.cpp [Tooling] Allow -flto flags and filter out -Wa, flags 2018-08-22 17:13:40 +00:00
Execution.cpp [Tooling] Expose ExecutorName option. 2018-10-12 11:47:36 +00:00
FileMatchTrie.cpp Remove \brief commands from doxygen comments. 2018-05-09 01:00:01 +00:00
FixIt.cpp [tooling] FixItHint Tooling refactoring 2016-05-11 14:31:39 +00:00
InterpolatingCompilationDatabase.cpp llvm::sort(C.begin(), C.end(), ...) -> llvm::sort(C, ...) 2018-09-26 22:16:28 +00:00
JSONCompilationDatabase.cpp [Tooling] JSONCompilationDatabasePlugin infers compile commands for missing files 2018-09-14 12:24:09 +00:00
Refactoring.cpp Apply clang-tidy's performance-unnecessary-value-param to parts of clang. 2017-03-21 21:35:04 +00:00
RefactoringCallbacks.cpp [tooling] RefactoringCallbacks code cleanup 2017-05-12 00:16:56 +00:00
StandaloneExecution.cpp Lift VFS from clang to llvm (NFC) 2018-10-10 13:27:25 +00:00
Tooling.cpp Fix use-after-free bug in Tooling. 2019-01-08 16:55:13 +00:00