mirror of
https://github.com/ethereum/solidity
synced 2023-10-03 13:03:40 +00:00
Make missing settings.optimizer.enabled key in Standard JSON equivalent to setting it to false
This commit is contained in:
parent
6b446bd46d
commit
59957b18dc
@ -8,7 +8,9 @@ Compiler Features:
|
||||
|
||||
Bugfixes:
|
||||
* Control Flow Graph: Fix incorrectly reported unreachable code.
|
||||
* Solc-Js: Use the same optimizer settings as ``solc`` when the ``--optimize`` flag is not specified.
|
||||
* Solc-Js: When running ``solcjs`` without the ``--optimize`` flag, use ``settings.optimizer.enabled=false`` in Standard JSON instead of omitting the key.
|
||||
* Standard JSON: Omitting ``settings.optimizer.enabled`` was not equivalent to setting it to ``false``.
|
||||
It meant disabling also the peephole optimizer and jumpdest remover which by default still run with ``enabled=false``.
|
||||
|
||||
|
||||
|
||||
|
@ -246,7 +246,10 @@ Input Description
|
||||
"remappings": [ ":g=/dir" ],
|
||||
// Optional: Optimizer settings
|
||||
"optimizer": {
|
||||
// disabled by default
|
||||
// Disabled by default.
|
||||
// NOTE: enabled=false still leaves some optimizations on. See comments below.
|
||||
// WARNING: Before version 0.8.6 omitting the 'enabled' key was not equivalent to setting
|
||||
// it to false and would actually disable all the optimizations.
|
||||
"enabled": true,
|
||||
// Optimize for how many times you intend to run the code.
|
||||
// Lower values will optimize more for initial deployment cost, higher
|
||||
|
@ -558,14 +558,15 @@ std::variant<OptimiserSettings, Json::Value> parseOptimizerSettings(Json::Value
|
||||
if (auto result = checkOptimizerKeys(_jsonInput))
|
||||
return *result;
|
||||
|
||||
OptimiserSettings settings = OptimiserSettings::none();
|
||||
OptimiserSettings settings = OptimiserSettings::minimal();
|
||||
|
||||
if (_jsonInput.isMember("enabled"))
|
||||
{
|
||||
if (!_jsonInput["enabled"].isBool())
|
||||
return formatFatalError("JSONError", "The \"enabled\" setting must be a Boolean.");
|
||||
|
||||
settings = _jsonInput["enabled"].asBool() ? OptimiserSettings::standard() : OptimiserSettings::minimal();
|
||||
if (_jsonInput["enabled"].asBool())
|
||||
settings = OptimiserSettings::standard();
|
||||
}
|
||||
|
||||
if (_jsonInput.isMember("runs"))
|
||||
|
Loading…
Reference in New Issue
Block a user