CommandLineInterface: Disallow --yul-dialect and --machine when not in assembly mode

This commit is contained in:
Kamil Śliwak 2020-05-29 23:28:09 +02:00
parent 8396002fe7
commit 0d7b3ae503
5 changed files with 17 additions and 0 deletions

View File

@ -1289,6 +1289,13 @@ bool CommandLineInterface::processInput()
return assemble(inputLanguage, targetMachine, optimize, yulOptimiserSteps);
}
else if (countEnabledOptions({g_strYulDialect, g_argMachine}) >= 1)
{
serr() << "--" << g_strYulDialect << " and --" << g_argMachine << " ";
serr() << "are only valid in assembly mode." << endl;
return false;
}
if (m_args.count(g_argLink))
{
// switch to linker mode

View File

@ -0,0 +1 @@
--yul-dialect evm --machine ewasm

View File

@ -0,0 +1 @@
--yul-dialect and --machine are only valid in assembly mode.

View File

@ -0,0 +1 @@
1

View File

@ -0,0 +1,7 @@
// SPDX-License-Identifier: GPL-3.0
pragma solidity >=0.0;
contract C
{
function f() public pure {}
}