This is an archive of the discontinued LLVM Phabricator instance.

MI Refactor CMIUtilSystemWindows::GetExecutablesPath()
ClosedPublic

Authored by ki.stfu on Apr 21 2015, 7:44 AM.

Details

Summary

My understanding of the Windows API call GetLastError() is that it should only be checked when ::GetModuleFileName() returns 0 on error.
Otherwise GetExecutablesPath() could return an error despite nLen being valid if GetLastError() was inconsistent.
Patch updates function to only call GetOSLastError() when nLen == 0

Patch from ewan@codeplay.com

Diff Detail

Repository
rL LLVM

Event Timeline

EwanCrawford retitled this revision from to MI Refactor CMIUtilSystemWindows::GetExecutablesPath().
EwanCrawford updated this object.
EwanCrawford edited the test plan for this revision. (Show Details)
EwanCrawford added a reviewer: ki.stfu.
EwanCrawford set the repository for this revision to rL LLVM.
EwanCrawford added subscribers: deepak2427, Unknown Object (MLST).
ki.stfu accepted this revision.EditedApr 21 2015, 12:54 PM
ki.stfu edited edge metadata.

lgtm. Should I commit it for you?

UPDATE:
btw, thx a lot! it annoyed me.

This revision is now accepted and ready to land.Apr 21 2015, 12:54 PM

Yes, thanks again.

ki.stfu commandeered this revision.Apr 22 2015, 6:43 AM
ki.stfu edited reviewers, added: EwanCrawford; removed: ki.stfu.
This revision now requires review to proceed.Apr 22 2015, 6:43 AM
ki.stfu updated this object.Apr 22 2015, 6:45 AM
ki.stfu updated this revision to Diff 24225.Apr 22 2015, 7:24 AM

Rebase against ToT

This revision was automatically updated to reflect the committed changes.