diff options
| author | Kuba Brecka <kuba.brecka@gmail.com> | 2015-12-03 17:05:43 +0000 |
|---|---|---|
| committer | Kuba Brecka <kuba.brecka@gmail.com> | 2015-12-03 17:05:43 +0000 |
| commit | 2e2f84bfee1ff1470c417e9df6410310cde8369b (patch) | |
| tree | d37e9557e629377937f2a4ab3199c67f2643314e | |
| parent | 3daf7b4743068ffd6d3be5593fc7f3071bbef866 (diff) | |
| download | bcm5719-llvm-2e2f84bfee1ff1470c417e9df6410310cde8369b.tar.gz bcm5719-llvm-2e2f84bfee1ff1470c417e9df6410310cde8369b.zip | |
[sanitizer] Replace a local array with InternalScopedString in MaybeReexec()
`MaybeReexec` contains a 1024-byte long local array, which produces a warning about frame size:
.../lib/sanitizer_common/sanitizer_mac.cc:548:6: warning: stack frame size of 1132 bytes in function '__sanitizer::MaybeReexec' [-Wframe-larger-than=]
Let's replace it with InternalScopedString.
Differential Revision: http://reviews.llvm.org/D15181
llvm-svn: 254619
| -rw-r--r-- | compiler-rt/lib/sanitizer_common/sanitizer_mac.cc | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/compiler-rt/lib/sanitizer_common/sanitizer_mac.cc b/compiler-rt/lib/sanitizer_common/sanitizer_mac.cc index 1702d6e0b21..46a4115c318 100644 --- a/compiler-rt/lib/sanitizer_common/sanitizer_mac.cc +++ b/compiler-rt/lib/sanitizer_common/sanitizer_mac.cc @@ -566,9 +566,9 @@ void MaybeReexec() { if (DyldNeedsEnvVariable() && !lib_is_in_env) { // DYLD_INSERT_LIBRARIES is not set or does not contain the runtime // library. - char program_name[1024]; - uint32_t buf_size = sizeof(program_name); - _NSGetExecutablePath(program_name, &buf_size); + InternalScopedString program_name(1024); + uint32_t buf_size = program_name.size(); + _NSGetExecutablePath(program_name.data(), &buf_size); char *new_env = const_cast<char*>(info.dli_fname); if (dyld_insert_libraries) { // Append the runtime dylib name to the existing value of @@ -589,7 +589,7 @@ void MaybeReexec() { VReport(1, "exec()-ing the program with\n"); VReport(1, "%s=%s\n", kDyldInsertLibraries, new_env); VReport(1, "to enable wrappers.\n"); - execv(program_name, *_NSGetArgv()); + execv(program_name.data(), *_NSGetArgv()); // We get here only if execv() failed. Report("ERROR: The process is launched without DYLD_INSERT_LIBRARIES, " |

