Disallow using both --optimize-yul and --no-optimize-yul at the same time

This commit is contained in:
Kamil Śliwak 2023-05-24 15:40:36 +02:00
parent b24e4fcbfa
commit a11b1c83f0
5 changed files with 11 additions and 1 deletions

View File

@ -9,6 +9,7 @@ Compiler Features:
Bugfixes:
* 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.

View File

@ -1146,6 +1146,13 @@ void CommandLineParser::processArgs()
m_options.output.eofVersion = 1;
}
if (m_args.count(g_strNoOptimizeYul) > 0 && m_args.count(g_strOptimizeYul) > 0)
solThrow(
CommandLineValidationError,
"Options --" + g_strOptimizeYul + " and --" + g_strNoOptimizeYul + " cannot be used together."
);
// We deliberately ignore --optimize-yul
m_options.optimizer.enabled = (m_args.count(g_strOptimize) > 0);
m_options.optimizer.noOptimizeYul = (m_args.count(g_strNoOptimizeYul) > 0);
if (!m_args[g_strOptimizeRuns].defaulted())

View File

@ -0,0 +1 @@
Options --optimize-yul and --no-optimize-yul cannot be used together.

View File

@ -1 +1 @@
The following options are invalid in assembly mode: --optimize-yul, --no-optimize-yul. Optimization is disabled by default and can be enabled with --optimize.
Options --optimize-yul and --no-optimize-yul cannot be used together.