This is an archive of the discontinued LLVM Phabricator instance.

[libFuzzer] Diff 17 - Implement DirName() for Windows.
AbandonedPublic

Authored by mpividori on Dec 6 2016, 11:51 AM.

Details

Reviewers
amccarth
zturner

Diff Detail

Repository
rL LLVM

Event Timeline

mpividori updated this revision to Diff 80460.Dec 6 2016, 11:51 AM
mpividori retitled this revision from to [libFuzzer] Diff 17 - Implement DirName() for Windows..
mpividori updated this object.
mpividori added reviewers: amccarth, zturner.
mpividori set the repository for this revision to rL LLVM.
mpividori added a subscriber: llvm-commits.
amccarth added inline comments.Dec 6 2016, 2:03 PM
lib/Fuzzer/FuzzerIOWindows.cpp
144

Instead of managing memory yourself, I would just use another string as the non-const buffer. PathRemoveFileSpace may replace one of the characters with '\0', so all you have to do is resize the result.

std::string result = FileName;
PathRemoveFileSpecA(&result[0]);
result.resize(std::strlen(result.c_str());
return result;
mpividori updated this revision to Diff 80490.Dec 6 2016, 2:49 PM
amccarth accepted this revision.Dec 6 2016, 2:53 PM
amccarth edited edge metadata.
This revision is now accepted and ready to land.Dec 6 2016, 2:53 PM
mpividori abandoned this revision.Dec 13 2016, 10:01 AM

Abandon this revision because I reimplemented DirName in: https://reviews.llvm.org/D27579