mirror of
https://github.com/ethereum/solidity
synced 2023-10-03 13:03:40 +00:00
6d9e9e1b1e
Old calculation did not ignore `optimize-runs` parameter, when creation code gas computations were done. This would lead to expanding values such as `shl(180, 1)` inside constructor code, even for the default value for `--optimize-runs`, i.e., 200.
17 lines
419 B
Solidity
17 lines
419 B
Solidity
// SPDX-License-Identifier: GPL-v3
|
|
pragma solidity >= 0.0.0;
|
|
contract C {
|
|
constructor () {
|
|
assembly {
|
|
// This shl should not be evaluated for all values of optimize-runs
|
|
sstore(0, shl(180, 1))
|
|
}
|
|
}
|
|
fallback() external {
|
|
assembly {
|
|
// This shl would be evaluated for high values of optimize-runs
|
|
sstore(0, shl(180, 1))
|
|
}
|
|
}
|
|
}
|