mirror of
https://github.com/ethereum/solidity
synced 2023-10-03 13:03:40 +00:00
CommandLineParser: Fix some outputs not being properly disallowed with --stop-after parsing
This commit is contained in:
parent
0713adde04
commit
f8a1af8bd5
@ -15,6 +15,7 @@ Compiler Features:
|
||||
|
||||
|
||||
Bugfixes:
|
||||
* Commandline Interface: Fix internal error when using ``--stop-after parsing`` and requesting some of the outputs that require full analysis or compilation.
|
||||
* Commandline Interface: It is no longer possible to specify both ``--optimize-yul`` and ``--no-optimize-yul`` at the same time.
|
||||
* SMTChecker: Fix encoding of side-effects inside ``if`` and ``ternary conditional``statements in the BMC engine.
|
||||
* SMTChecker: Fix false negative when a verification target can be violated only by trusted external call from another public function.
|
||||
|
@ -997,21 +997,11 @@ void CommandLineParser::processArgs()
|
||||
return;
|
||||
|
||||
checkMutuallyExclusive({g_strColor, g_strNoColor});
|
||||
checkMutuallyExclusive({g_strStopAfter, g_strGas});
|
||||
|
||||
array<string, 9> const conflictingWithStopAfter{
|
||||
CompilerOutputs::componentName(&CompilerOutputs::binary),
|
||||
CompilerOutputs::componentName(&CompilerOutputs::ir),
|
||||
CompilerOutputs::componentName(&CompilerOutputs::irAstJson),
|
||||
CompilerOutputs::componentName(&CompilerOutputs::irOptimized),
|
||||
CompilerOutputs::componentName(&CompilerOutputs::irOptimizedAstJson),
|
||||
g_strGas,
|
||||
CompilerOutputs::componentName(&CompilerOutputs::asm_),
|
||||
CompilerOutputs::componentName(&CompilerOutputs::asmJson),
|
||||
CompilerOutputs::componentName(&CompilerOutputs::opcodes),
|
||||
};
|
||||
|
||||
for (auto& option: conflictingWithStopAfter)
|
||||
checkMutuallyExclusive({g_strStopAfter, option});
|
||||
for (string const& option: CompilerOutputs::componentMap() | ranges::views::keys)
|
||||
if (option != CompilerOutputs::componentName(&CompilerOutputs::astCompactJson))
|
||||
checkMutuallyExclusive({g_strStopAfter, option});
|
||||
|
||||
if (
|
||||
m_options.input.mode != InputMode::Compiler &&
|
||||
|
1
test/cmdlineTests/stop_after_parsing_abi/args
Normal file
1
test/cmdlineTests/stop_after_parsing_abi/args
Normal file
@ -0,0 +1 @@
|
||||
--pretty-json --json-indent 4 --stop-after parsing --abi
|
1
test/cmdlineTests/stop_after_parsing_abi/err
Normal file
1
test/cmdlineTests/stop_after_parsing_abi/err
Normal file
@ -0,0 +1 @@
|
||||
The following options are mutually exclusive: --stop-after, --abi. Select at most one.
|
1
test/cmdlineTests/stop_after_parsing_abi/exit
Normal file
1
test/cmdlineTests/stop_after_parsing_abi/exit
Normal file
@ -0,0 +1 @@
|
||||
1
|
8
test/cmdlineTests/stop_after_parsing_abi/input.sol
Normal file
8
test/cmdlineTests/stop_after_parsing_abi/input.sol
Normal file
@ -0,0 +1,8 @@
|
||||
// SPDX-License-Identifier: GPL-3.0
|
||||
pragma solidity *;
|
||||
|
||||
import "A";
|
||||
|
||||
contract C {
|
||||
function f() public {}
|
||||
}
|
Loading…
Reference in New Issue
Block a user