[compiler-rt] r259005 - GetArgv returns null on widnows, do not crash
Mike Aizatsky via llvm-commits
llvm-commits at lists.llvm.org
Wed Jan 27 16:31:49 PST 2016
Author: aizatsky
Date: Wed Jan 27 18:31:49 2016
New Revision: 259005
URL: http://llvm.org/viewvc/llvm-project?rev=259005&view=rev
Log:
GetArgv returns null on widnows, do not crash
Modified:
compiler-rt/trunk/lib/sanitizer_common/sanitizer_coverage_libcdep.cc
Modified: compiler-rt/trunk/lib/sanitizer_common/sanitizer_coverage_libcdep.cc
URL: http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/lib/sanitizer_common/sanitizer_coverage_libcdep.cc?rev=259005&r1=259004&r2=259005&view=diff
==============================================================================
--- compiler-rt/trunk/lib/sanitizer_common/sanitizer_coverage_libcdep.cc (original)
+++ compiler-rt/trunk/lib/sanitizer_common/sanitizer_coverage_libcdep.cc Wed Jan 27 18:31:49 2016
@@ -811,8 +811,10 @@ void CoverageData::DumpOffsets() {
InternalMmapVector<char *> sancov_argv(module_name_vec.size() + 2);
sancov_argv.push_back(FindPathToBinary(common_flags()->sancov_path));
- sancov_argv.push_back(internal_strdup("-obj"));
- sancov_argv.push_back(internal_strdup(GetArgv()[0]));
+ if (GetArgv() != nullptr) {
+ sancov_argv.push_back(internal_strdup("-obj"));
+ sancov_argv.push_back(internal_strdup(GetArgv()[0]));
+ }
sancov_argv.push_back(internal_strdup("-html-report"));
auto argv_deleter = at_scope_exit([&] {
for (uptr i = 0; i < sancov_argv.size(); ++i) {
More information about the llvm-commits
mailing list