[llvm-commits] [compiler-rt] r172975 - /compiler-rt/trunk/lib/sanitizer_common/sanitizer_common.cc

Alexey Samsonov samsonov at google.com
Sun Jan 20 05:22:06 PST 2013


Author: samsonov
Date: Sun Jan 20 07:22:06 2013
New Revision: 172975

URL: http://llvm.org/viewvc/llvm-project?rev=172975&view=rev
Log:
Fixup for r172828: use InternalScopedBuffer in favor of large stack buffers

Modified:
    compiler-rt/trunk/lib/sanitizer_common/sanitizer_common.cc

Modified: compiler-rt/trunk/lib/sanitizer_common/sanitizer_common.cc
URL: http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/lib/sanitizer_common/sanitizer_common.cc?rev=172975&r1=172974&r2=172975&view=diff
==============================================================================
--- compiler-rt/trunk/lib/sanitizer_common/sanitizer_common.cc (original)
+++ compiler-rt/trunk/lib/sanitizer_common/sanitizer_common.cc Sun Jan 20 07:22:06 2013
@@ -63,14 +63,14 @@
 
 static void MaybeOpenReportFile() {
   if (!log_to_file || (report_fd_pid == GetPid())) return;
-  char report_path_full[4096];
-  internal_snprintf(report_path_full, sizeof(report_path_full),
+  InternalScopedBuffer<char> report_path_full(4096);
+  internal_snprintf(report_path_full.data(), report_path_full.size(),
                     "%s.%d", report_path_prefix, GetPid());
-  fd_t fd = internal_open(report_path_full, true);
+  fd_t fd = internal_open(report_path_full.data(), true);
   if (fd == kInvalidFd) {
     report_fd = kStderrFd;
     log_to_file = false;
-    Report("ERROR: Can't open file: %s\n", report_path_full);
+    Report("ERROR: Can't open file: %s\n", report_path_full.data());
     Die();
   }
   if (report_fd != kInvalidFd) {





More information about the llvm-commits mailing list