[PATCH] D55765: Fix use-after-free bug in Tooling.

2019-01-08 Thread Alexander Kornienko via Phabricator via cfe-commits
This revision was automatically updated to reflect the committed changes. Closed by commit rL350638: Fix use-after-free bug in Tooling. (authored by alexfh, committed by ). Herald added a subscriber: llvm-commits. Repository: rL LLVM CHANGES SINCE LAST ACTION https://reviews.llvm.org/D55765/

[PATCH] D55765: Fix use-after-free bug in Tooling.

2018-12-18 Thread Yitzhak Mandelbaum via Phabricator via cfe-commits
ymandel added a comment. Alex, would you mind submitting this since I don't yet have submit privileges? I'll request them shortly, but I'd rather this go one in the meantime. Repository: rC Clang CHANGES SINCE LAST ACTION https://reviews.llvm.org/D55765/new/ https://reviews.llvm.org/D5576

[PATCH] D55765: Fix use-after-free bug in Tooling.

2018-12-18 Thread Alexander Kornienko via Phabricator via cfe-commits
alexfh accepted this revision. alexfh added a comment. This revision is now accepted and ready to land. LG Repository: rC Clang CHANGES SINCE LAST ACTION https://reviews.llvm.org/D55765/new/ https://reviews.llvm.org/D55765 ___ cfe-commits mail

[PATCH] D55765: Fix use-after-free bug in Tooling.

2018-12-18 Thread Yitzhak Mandelbaum via Phabricator via cfe-commits
ymandel updated this revision to Diff 178653. ymandel added a comment. Adjust comments. Repository: rC Clang CHANGES SINCE LAST ACTION https://reviews.llvm.org/D55765/new/ https://reviews.llvm.org/D55765 Files: include/clang/Tooling/Tooling.h lib/Tooling/Tooling.cpp unittests/Analys

[PATCH] D55765: Fix use-after-free bug in Tooling.

2018-12-18 Thread Yitzhak Mandelbaum via Phabricator via cfe-commits
ymandel updated this revision to Diff 178651. ymandel added a comment. Convert other Twine-typed args to StringRef. Repository: rC Clang CHANGES SINCE LAST ACTION https://reviews.llvm.org/D55765/new/ https://reviews.llvm.org/D55765 Files: include/clang/Tooling/Tooling.h lib/Tooling/To

[PATCH] D55765: Fix use-after-free bug in Tooling.

2018-12-17 Thread Alexander Kornienko via Phabricator via cfe-commits
alexfh added inline comments. Comment at: include/clang/Tooling/Tooling.h:208 std::unique_ptr -buildASTFromCode(const Twine &Code, const Twine &FileName = "input.cc", +buildASTFromCode(StringRef Code, const Twine &FileName = "input.cc", std::shared_ptr PCHConta

[PATCH] D55765: Fix use-after-free bug in Tooling.

2018-12-17 Thread Yitzhak Mandelbaum via Phabricator via cfe-commits
ymandel updated this revision to Diff 178507. ymandel added a comment. Update test that was calling builAST with an actual Twine. Repository: rC Clang CHANGES SINCE LAST ACTION https://reviews.llvm.org/D55765/new/ https://reviews.llvm.org/D55765 Files: include/clang/Tooling/Tooling.h

[PATCH] D55765: Fix use-after-free bug in Tooling.

2018-12-17 Thread Yitzhak Mandelbaum via Phabricator via cfe-commits
ymandel updated this revision to Diff 178470. ymandel added a comment. Change header correspondingly. Repository: rC Clang CHANGES SINCE LAST ACTION https://reviews.llvm.org/D55765/new/ https://reviews.llvm.org/D55765 Files: include/clang/Tooling/Tooling.h lib/Tooling/Tooling.cpp In

[PATCH] D55765: Fix use-after-free bug in Tooling.

2018-12-17 Thread Yitzhak Mandelbaum via Phabricator via cfe-commits
ymandel updated this revision to Diff 178468. ymandel added a comment. Change buildAST functions to take a StringRef instead of a Twine. In practice, code is almost never constructed on the fly using a Twine, so StringRef is simpler and avoids needing a copy when constructing the MemBuffer. Re

[PATCH] D55765: Fix use-after-free bug in Tooling.

2018-12-17 Thread Yitzhak Mandelbaum via Phabricator via cfe-commits
ymandel created this revision. ymandel added a reviewer: alexfh. Herald added a subscriber: cfe-commits. `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