[PATCH] D58552: [compiler-rt] Windows Trace Logging for error reports.
Vitaly Buka via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Tue Feb 26 13:17:29 PST 2019
vitalybuka added inline comments.
================
Comment at: lib/sanitizer_common/sanitizer_win.cc:1069
+TRACELOGGING_DECLARE_PROVIDER(g_hAsanProvider);
+TRACELOGGING_DEFINE_PROVIDER(g_hAsanProvider, "AddressSanitizerLoggingProvider",
----------------
historically sanitizers use Google style
```
g_hAsanProvider -> g_asan_provider
Filename -> filename
```
================
Comment at: lib/sanitizer_common/sanitizer_win.cc:1077
+ char Filename[MAX_PATH + 1];
+ internal_memset(Filename, 0, MAX_PATH + 1);
+ GetModuleFileNameA(NULL, Filename, MAX_PATH);
----------------
MAX_PATH + 1 -> sizeof(Filename)
GetModuleFileNameA(NULL, Filename, sizeof(Filename) - 1);
================
Comment at: lib/sanitizer_common/sanitizer_win.cc:1078
+ internal_memset(Filename, 0, MAX_PATH + 1);
+ GetModuleFileNameA(NULL, Filename, MAX_PATH);
+ HRESULT hr = TraceLoggingRegister(g_hAsanProvider);
----------------
also why MAX_PATH and why non unicode version?
also GetModuleFileNameA may truncate the string
Better to use the size returned from GetModuleFileName
and dynamically allocated with InternalScopedString or InternalMmapVector(for unicode)
Repository:
rCRT Compiler Runtime
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D58552/new/
https://reviews.llvm.org/D58552
More information about the llvm-commits
mailing list