Solidity v0.8.6 fixes some non-critical but annoying bugs, especially a warning about unreachable code that is in fact reachable.
With Solidity 0.8.5, we released a new feature that detects if code is unreachable because a called function always reverts before the code is executed. This detection contained a bug in connection with nested calls to internal library functions where the “reverting behaviour” of a function was not properly updated after a function called by it was determined to be not always reverting.
Because the bug was rather common, we are releasing this version with an unusually short changelog.
We discovered that the default optimizer setting differed depending on the way
the compiler was invoked: Using the compiler on the commandline (“
caused minimal optimizer features to be activated (the intended functionality)
solc-js all optimizer features were disabled.
These minimal features are the “peephole optimizer”, a routine that performs
obvious replacements like removing
PUSH1 0 POP and the “jumpdest remover”
which removes code that is not jumped to from anywhere.
The peephole optimizer and the jumpdest remover are activated even when
false in Standard JSON
and have to be explicitly disabled in the detailed settings.
The bug was that providing a value for
settings.optimizer but not including
enabled in it was not equivalent to setting
It was equivalent to explicitly disabling all optimizer components.
settings.optimizer was not provided at all, the bug did not manifest.
- Yul: Special meaning of
".metadata"data object in Yul object.
- Control Flow Graph: Fix incorrectly reported unreachable code.
- Solc-Js: When running
settings.optimizer.enabled=falsein Standard JSON instead of omitting the key.
- Standard JSON: Omitting
settings.optimizer.enabledwas not equivalent to setting it to
false. It meant disabling also the peephole optimizer and jumpdest remover which by default still run with
A big thank you to all contributors who helped make this release possible!
Download the new version of Solidity here.