mirror of
https://github.com/ethereum/solidity
synced 2023-10-03 13:03:40 +00:00
Remove entry in IR breaking changes.
This commit is contained in:
parent
187f0f070d
commit
27822dbca7
@ -154,37 +154,6 @@ hiding new and different behavior in existing code.
|
||||
- New code generator: ``0`` as all parameters, including return parameters, will be re-initialized before
|
||||
each ``_;`` evaluation.
|
||||
|
||||
- Copying ``bytes`` arrays from memory to storage is implemented in a different way.
|
||||
The old code generator always copies full words, while the new one cuts the byte
|
||||
array after its end. The old behaviour can lead to dirty data being copied after
|
||||
the end of the array (but still in the same storage slot).
|
||||
This causes differences in some contracts, for example:
|
||||
|
||||
.. code-block:: solidity
|
||||
|
||||
// SPDX-License-Identifier: GPL-3.0
|
||||
pragma solidity >=0.8.1;
|
||||
|
||||
contract C {
|
||||
bytes x;
|
||||
function f() public returns (uint r) {
|
||||
bytes memory m = "tmp";
|
||||
assembly {
|
||||
mstore(m, 8)
|
||||
mstore(add(m, 32), "deadbeef15dead")
|
||||
}
|
||||
x = m;
|
||||
assembly {
|
||||
r := sload(x.slot)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Previously ``f()`` would return ``0x6465616462656566313564656164000000000000000000000000000000000010``
|
||||
(it has correct length, and correct first 8 elements, but then it contains dirty data which was set via assembly).
|
||||
Now it is returning ``0x6465616462656566000000000000000000000000000000000000000000000010`` (it has
|
||||
correct length, and correct elements, but does not contain superfluous data).
|
||||
|
||||
.. index:: ! evaluation order; expression
|
||||
|
||||
- For the old code generator, the evaluation order of expressions is unspecified.
|
||||
|
Loading…
Reference in New Issue
Block a user