[PATCH] D46398: [ASTImporterTest] Fix potential use-after-free

2018-05-14 Thread Aleksei Sidorin via Phabricator via cfe-commits
a.sidorin closed this revision. a.sidorin added a comment. Closed with https://reviews.llvm.org/rC332256. Repository: rC Clang https://reviews.llvm.org/D46398 ___ cfe-commits mailing list cfe-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/m

[PATCH] D46398: [ASTImporterTest] Fix potential use-after-free

2018-05-14 Thread Gabor Marton via Phabricator via cfe-commits
martong accepted this revision. martong added a comment. This revision is now accepted and ready to land. LGTM! Repository: rC Clang https://reviews.llvm.org/D46398 ___ cfe-commits mailing list cfe-commits@lists.llvm.org http://lists.llvm.org/cgi

[PATCH] D46398: [ASTImporterTest] Fix potential use-after-free

2018-05-14 Thread Aleksei Sidorin via Phabricator via cfe-commits
a.sidorin updated this revision to Diff 146589. a.sidorin added a comment. Add forgotten context. Repository: rC Clang https://reviews.llvm.org/D46398 Files: unittests/AST/ASTImporterTest.cpp Index: unittests/AST/ASTImporterTest.cpp ===

[PATCH] D46398: [ASTImporterTest] Fix potential use-after-free

2018-05-14 Thread Aleksei Sidorin via Phabricator via cfe-commits
a.sidorin updated this revision to Diff 146587. a.sidorin added a comment. After a number of attempts of Twine'ifying all Code samples, I decided to restore the initial state of this code. Repository: rC Clang https://reviews.llvm.org/D46398 Files: unittests/AST/ASTImporterTest.cpp Inde

[PATCH] D46398: [ASTImporterTest] Fix potential use-after-free

2018-05-04 Thread Aleksei Sidorin via Phabricator via cfe-commits
a.sidorin added subscribers: pcc, klimek. a.sidorin added a comment. Hi Gabor, > Can't we have the same problem with FileName? As I can see, no. FileName is copied into std::string while building compilation arguments. > Perhaps an other alternative would be to make the members real strings.

[PATCH] D46398: [ASTImporterTest] Fix potential use-after-free

2018-05-04 Thread Gabor Marton via Phabricator via cfe-commits
martong added inline comments. Comment at: unittests/AST/ASTImporterTest.cpp:211 StringRef Code; StringRef FileName; std::unique_ptr Unit; Can't we have the same problem with FileName? Perhaps an other alternative would be to make the members real

[PATCH] D46398: [ASTImporterTest] Fix potential use-after-free

2018-05-03 Thread Aleksei Sidorin via Phabricator via cfe-commits
a.sidorin created this revision. a.sidorin added reviewers: xazax.hun, martong, szepet, jingham. Herald added subscribers: cfe-commits, rnkovacs. `buildASTFromCodeWithArgs()` accepts `llvm::Twine` as `Code` argument. However, if the argument is not a C string or std::string, the argument is being