From 2d04812a45fde62828b42d889095b0baa4e451eb Mon Sep 17 00:00:00 2001 From: Alexey Samsonov Date: Sun, 20 Jan 2013 13:22:06 +0000 Subject: [PATCH] Fixup for r172828: use InternalScopedBuffer in favor of large stack buffers llvm-svn: 172975 --- compiler-rt/lib/sanitizer_common/sanitizer_common.cc | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/compiler-rt/lib/sanitizer_common/sanitizer_common.cc b/compiler-rt/lib/sanitizer_common/sanitizer_common.cc index 4a8d9a7..07223b2 100644 --- a/compiler-rt/lib/sanitizer_common/sanitizer_common.cc +++ b/compiler-rt/lib/sanitizer_common/sanitizer_common.cc @@ -63,14 +63,14 @@ void NORETURN CheckFailed(const char *file, int line, const char *cond, 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 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) { -- 2.7.4