[PATCH] D47578: Do not enforce absolute path argv0 in windows

Rui Ueyama via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Fri Jun 8 14:35:56 PDT 2018


ruiu added inline comments.


================
Comment at: llvm/lib/Support/Windows/Process.inc:227
     return mapWindowsError(GetLastError());
-  if (Length > LongPath.capacity()) {
+  if (static_cast<size_t>(Length) > MAX_PATH) {
     // We're not going to try to deal with paths longer than MAX_PATH, so we'll
----------------
and eliminate this static_cast.


================
Comment at: llvm/lib/Support/Windows/Process.inc:234
+
+  std::error_code ec = windows::UTF16ToUTF8(ModuleName, Length, Filename);
+  if (ec)
----------------
ec -> EC


================
Comment at: llvm/lib/Support/Windows/Process.inc:252
 
-  Args.reserve(ArgCount);
   std::error_code ec;
 
----------------
EC


================
Comment at: llvm/lib/Support/Windows/Process.inc:256
 
-  for (int i = 1; i < ArgCount && !ec; ++i) {
+  for (int i = 0; i < ArgCount; ++i) {
     ec = WildcardExpand(UnicodeCommandLine[i], Args, Alloc);
----------------
I


https://reviews.llvm.org/D47578





More information about the llvm-commits mailing list