From ce76472d491b8122b4bdf0623bed3d3ed986ba17 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Kamil=20=C5=9Aliwak?= Date: Wed, 24 May 2023 14:46:06 +0200 Subject: [PATCH] Disable optimizeStackAllocation when --no-optimize-yul is used for consistency with StandardCompiler --- Changelog.md | 1 + solc/CommandLineParser.cpp | 1 + 2 files changed, 2 insertions(+) diff --git a/Changelog.md b/Changelog.md index 2272131b1..788ed2e68 100644 --- a/Changelog.md +++ b/Changelog.md @@ -13,6 +13,7 @@ Compiler Features: Bugfixes: + * Commandline Interface: ``--no-optimize-yul`` would not disable optimized stack allocation (unlike setting ``settings.optimizer.details.yul`` to ``false`` in Standard JSON). * 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. diff --git a/solc/CommandLineParser.cpp b/solc/CommandLineParser.cpp index 514073389..d50e4201d 100644 --- a/solc/CommandLineParser.cpp +++ b/solc/CommandLineParser.cpp @@ -265,6 +265,7 @@ OptimiserSettings CommandLineOptions::optimiserSettings() const if (optimizer.noOptimizeYul) settings.runYulOptimiser = false; + settings.optimizeStackAllocation = settings.runYulOptimiser; if (optimizer.expectedExecutionsPerDeployment.has_value()) settings.expectedExecutionsPerDeployment = optimizer.expectedExecutionsPerDeployment.value();