Unverified Commit 4fbfa2f3 by Dominic Hamon Committed by GitHub

Some platforms and environments don't pass a valid argc/argv. (#607)

Specifically some iOS targets.
parent d07372e6
...@@ -568,7 +568,8 @@ void PrintUsageAndExit() { ...@@ -568,7 +568,8 @@ void PrintUsageAndExit() {
void ParseCommandLineFlags(int* argc, char** argv) { void ParseCommandLineFlags(int* argc, char** argv) {
using namespace benchmark; using namespace benchmark;
BenchmarkReporter::Context::executable_name = argv[0]; BenchmarkReporter::Context::executable_name =
(argc && *argc > 0) ? argv[0] : "unknown";
for (int i = 1; i < *argc; ++i) { for (int i = 1; i < *argc; ++i) {
if (ParseBoolFlag(argv[i], "benchmark_list_tests", if (ParseBoolFlag(argv[i], "benchmark_list_tests",
&FLAGS_benchmark_list_tests) || &FLAGS_benchmark_list_tests) ||
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment