[PATCH] D58766: [sanitizers] Explicitly use GetModuleFileNameW with wchar_t

Martin Storsjö via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu Feb 28 02:44:50 PST 2019


mstorsjo created this revision.
mstorsjo added reviewers: rnk, mcgov.
Herald added subscribers: Sanitizers, jdoerfert, kubamracek.
Herald added projects: LLVM, Sanitizers.

Alternatively we could define the string as TCHAR.

This fixes building with clang-cl in setups where UNICODE isn't defined (which seems to be the case when building compiler-rt standalone outside of the llvm tree).


Repository:
  rCRT Compiler Runtime

https://reviews.llvm.org/D58766

Files:
  lib/sanitizer_common/sanitizer_win.cc


Index: lib/sanitizer_common/sanitizer_win.cc
===================================================================
--- lib/sanitizer_common/sanitizer_win.cc
+++ lib/sanitizer_common/sanitizer_win.cc
@@ -1103,7 +1103,7 @@
     do {
       filename.resize(filename.size() + 0x100);
       filename_length =
-          GetModuleFileName(NULL, filename.begin(), filename.size());
+          GetModuleFileNameW(NULL, filename.begin(), filename.size());
     } while (filename_length >= filename.size());
     TraceLoggingWrite(g_asan_provider, "AsanReportEvent",
                       TraceLoggingValue(filename.begin(), "ExecutableName"),


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D58766.188692.patch
Type: text/x-patch
Size: 634 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20190228/c205de76/attachment.bin>


More information about the llvm-commits mailing list