Fix --help parameter for solfuzzer

the `readStandardInput()` branch would be taken if "input-file" was not
given and only "help", thus never reaching the check for "help"
This commit is contained in:
Mathias Baumann 2019-04-01 15:50:34 +02:00
parent a3a60b8eb9
commit 101ca5c120

View File

@ -84,18 +84,22 @@ Allowed options)",
return 1;
}
if (arguments.count("quiet"))
quiet = true;
if (arguments.count("help"))
{
cout << options;
return 0;
}
string input;
if (arguments.count("input-file"))
input = readFileAsString(arguments["input-file"].as<string>());
else
input = readStandardInput();
if (arguments.count("quiet"))
quiet = true;
if (arguments.count("help"))
cout << options;
else if (arguments.count("const-opt"))
if (arguments.count("const-opt"))
FuzzerUtil::testConstantOptimizer(input, quiet);
else if (arguments.count("standard-json"))
FuzzerUtil::testStandardCompiler(input, quiet);