[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 Nov 20 01:45:30 PST 2020


mstorsjo created this revision.
mstorsjo added reviewers: mcgov, amccarth.
Herald added subscribers: Sanitizers, dberris.
Herald added a project: Sanitizers.
mstorsjo requested review of this revision.

Alternatively SANITIZER_LIMIT_FRAME_SIZE could be disabled altogether when building for windows.


Repository:
  rG LLVM Github Monorepo

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,6 +133,10 @@
   }
 }
 
+#ifdef __clang__
+#pragma clang diagnostic push
+#pragma clang diagnostic ignored "-Wframe-larger-than="
+#endif
 bool WinSymbolizerTool::SymbolizePC(uptr addr, SymbolizedStack *frame) {
   InitializeDbgHelpIfNeeded();
 
@@ -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.306625.patch
Type: text/x-patch
Size: 2199 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20201120/cd5a4870/attachment.bin>


More information about the llvm-commits mailing list