[PATCH] D91853: [compiler-rt] [sanitizer] Silence -Wframe-larger-than= for a few windows functions with large stack buffers
Martin Storsjö via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Fri Jan 8 12:55:08 PST 2021
This revision was automatically updated to reflect the committed changes.
Closed by commit rGffac9001d987: [compiler-rt] [sanitizer] Silence -Wframe-larger-than= for a few windows… (authored by mstorsjo).
Changed prior to commit:
https://reviews.llvm.org/D91853?vs=306625&id=315496#toc
Repository:
rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D91853/new/
https://reviews.llvm.org/D91853
Files:
compiler-rt/lib/sanitizer_common/sanitizer_symbolizer_win.cpp
compiler-rt/lib/sanitizer_common/sanitizer_unwind_win.cpp
compiler-rt/lib/sanitizer_common/sanitizer_win.cpp
Index: compiler-rt/lib/sanitizer_common/sanitizer_win.cpp
===================================================================
--- compiler-rt/lib/sanitizer_common/sanitizer_win.cpp
+++ compiler-rt/lib/sanitizer_common/sanitizer_win.cpp
@@ -611,6 +611,10 @@
return (uptr)pe_header->ImageBase;
}
+#ifdef __clang__
+#pragma clang diagnostic push
+#pragma clang diagnostic ignored "-Wframe-larger-than="
+#endif
void ListOfModules::init() {
clearOrInit();
HANDLE cur_process = GetCurrentProcess();
@@ -672,6 +676,9 @@
}
UnmapOrDie(hmodules, modules_buffer_size);
}
+#ifdef __clang__
+#pragma clang diagnostic pop
+#endif
void ListOfModules::fallbackInit() { clear(); }
Index: compiler-rt/lib/sanitizer_common/sanitizer_unwind_win.cpp
===================================================================
--- compiler-rt/lib/sanitizer_common/sanitizer_unwind_win.cpp
+++ compiler-rt/lib/sanitizer_common/sanitizer_unwind_win.cpp
@@ -43,6 +43,10 @@
trace_buffer[0] = pc;
}
+#ifdef __clang__
+#pragma clang diagnostic push
+#pragma clang diagnostic ignored "-Wframe-larger-than="
+#endif
void BufferedStackTrace::UnwindSlow(uptr pc, void *context, u32 max_depth) {
CHECK(context);
CHECK_GE(max_depth, 2);
@@ -74,6 +78,9 @@
trace_buffer[size++] = (uptr)stack_frame.AddrPC.Offset;
}
}
+#ifdef __clang__
+#pragma clang diagnostic pop
+#endif
#endif // #if !SANITIZER_GO
#endif // SANITIZER_WINDOWS
Index: compiler-rt/lib/sanitizer_common/sanitizer_symbolizer_win.cpp
===================================================================
--- compiler-rt/lib/sanitizer_common/sanitizer_symbolizer_win.cpp
+++ compiler-rt/lib/sanitizer_common/sanitizer_symbolizer_win.cpp
@@ -133,10 +133,14 @@
}
}
+#ifdef __clang__
+#pragma clang diagnostic push
+#pragma clang diagnostic ignored "-Wframe-larger-than="
+#endif
bool WinSymbolizerTool::SymbolizePC(uptr addr, SymbolizedStack *frame) {
InitializeDbgHelpIfNeeded();
- // See http://msdn.microsoft.com/en-us/library/ms680578(VS.85).aspx
+ // See https://docs.microsoft.com/en-us/windows/win32/debug/retrieving-symbol-information-by-address
char buffer[sizeof(SYMBOL_INFO) + MAX_SYM_NAME * sizeof(CHAR)];
PSYMBOL_INFO symbol = (PSYMBOL_INFO)buffer;
symbol->SizeOfStruct = sizeof(SYMBOL_INFO);
@@ -162,6 +166,9 @@
// Otherwise, try llvm-symbolizer.
return got_fileline;
}
+#ifdef __clang__
+#pragma clang diagnostic pop
+#endif
const char *WinSymbolizerTool::Demangle(const char *name) {
CHECK(is_dbghelp_initialized);
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D91853.315496.patch
Type: text/x-patch
Size: 2536 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20210108/5ecdefbb/attachment.bin>
More information about the llvm-commits
mailing list