mirror of
https://github.com/ethereum/solidity
synced 2023-10-03 13:03:40 +00:00
CommandLineInterface: Disallow --output-dir, --gas and --combined-json in assembly mode
This commit is contained in:
parent
0d7b3ae503
commit
4bd078ed7e
@ -1190,6 +1190,22 @@ bool CommandLineInterface::processInput()
|
|||||||
|
|
||||||
if (m_args.count(g_argAssemble) || m_args.count(g_argStrictAssembly) || m_args.count(g_argYul))
|
if (m_args.count(g_argAssemble) || m_args.count(g_argStrictAssembly) || m_args.count(g_argYul))
|
||||||
{
|
{
|
||||||
|
vector<string> const nonAssemblyModeOptions = {
|
||||||
|
// TODO: The list is not complete. Add more.
|
||||||
|
g_argOutputDir,
|
||||||
|
g_argGas,
|
||||||
|
g_argCombinedJson,
|
||||||
|
g_strOptimizeYul,
|
||||||
|
g_strNoOptimizeYul,
|
||||||
|
};
|
||||||
|
if (countEnabledOptions(nonAssemblyModeOptions) >= 1)
|
||||||
|
{
|
||||||
|
serr() << "The following options are invalid in assembly mode: ";
|
||||||
|
serr() << joinOptionNames(nonAssemblyModeOptions) << ". ";
|
||||||
|
serr() << "Optimization is disabled by default and can be enabled with --" << g_argOptimize << "." << endl;
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
// switch to assembly mode
|
// switch to assembly mode
|
||||||
m_onlyAssemble = true;
|
m_onlyAssemble = true;
|
||||||
using Input = yul::AssemblyStack::Language;
|
using Input = yul::AssemblyStack::Language;
|
||||||
@ -1197,16 +1213,6 @@ bool CommandLineInterface::processInput()
|
|||||||
Input inputLanguage = m_args.count(g_argYul) ? Input::Yul : (m_args.count(g_argStrictAssembly) ? Input::StrictAssembly : Input::Assembly);
|
Input inputLanguage = m_args.count(g_argYul) ? Input::Yul : (m_args.count(g_argStrictAssembly) ? Input::StrictAssembly : Input::Assembly);
|
||||||
Machine targetMachine = Machine::EVM;
|
Machine targetMachine = Machine::EVM;
|
||||||
bool optimize = m_args.count(g_argOptimize);
|
bool optimize = m_args.count(g_argOptimize);
|
||||||
if (m_args.count(g_strOptimizeYul))
|
|
||||||
{
|
|
||||||
serr() << "--" << g_strOptimizeYul << " is invalid in assembly mode. Use --" << g_argOptimize << " instead." << endl;
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
if (m_args.count(g_strNoOptimizeYul))
|
|
||||||
{
|
|
||||||
serr() << "--" << g_strNoOptimizeYul << " is invalid in assembly mode. Optimization is disabled by default and can be enabled with --" << g_argOptimize << "." << endl;
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
|
|
||||||
optional<string> yulOptimiserSteps;
|
optional<string> yulOptimiserSteps;
|
||||||
if (m_args.count(g_strYulOptimizations))
|
if (m_args.count(g_strYulOptimizations))
|
||||||
|
@ -0,0 +1 @@
|
|||||||
|
--strict-assembly --output-dir /tmp/
|
@ -0,0 +1 @@
|
|||||||
|
The following options are invalid in assembly mode: --output-dir, --gas, --combined-json, --optimize-yul, --no-optimize-yul. Optimization is disabled by default and can be enabled with --optimize.
|
@ -0,0 +1 @@
|
|||||||
|
1
|
@ -0,0 +1,3 @@
|
|||||||
|
{
|
||||||
|
sstore(0, 1)
|
||||||
|
}
|
Loading…
Reference in New Issue
Block a user