[PATCH] D83321: [Support] Fix utf16 path's index upper bound

Ding Fei via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed Jul 8 17:35:47 PDT 2020


danix800 updated this revision to Diff 276609.
danix800 added a comment.

Full context attached.


CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D83321/new/

https://reviews.llvm.org/D83321

Files:
  llvm/lib/Support/Windows/Path.inc


Index: llvm/lib/Support/Windows/Path.inc
===================================================================
--- llvm/lib/Support/Windows/Path.inc
+++ llvm/lib/Support/Windows/Path.inc
@@ -958,8 +958,8 @@
 
   // Convert path to the format that Windows is happy with.
   if (PathUTF16.size() > 0 &&
-      !is_separator(PathUTF16[Path.size() - 1]) &&
-      PathUTF16[Path.size() - 1] != L':') {
+      !is_separator(PathUTF16[PathUTF16.size() - 1]) &&
+      PathUTF16[PathUTF16.size() - 1] != L':') {
     PathUTF16.push_back(L'\\');
     PathUTF16.push_back(L'*');
   } else {


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D83321.276609.patch
Type: text/x-patch
Size: 580 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20200709/5e0ca3b7/attachment.bin>


More information about the llvm-commits mailing list