@@ -154,37 +154,6 @@ hiding new and different behavior in existing code.
154
154
- New code generator: ``0 `` as all parameters, including return parameters, will be re-initialized before
155
155
each ``_; `` evaluation.
156
156
157
- - Copying ``bytes `` arrays from memory to storage is implemented in a different way.
158
- The old code generator always copies full words, while the new one cuts the byte
159
- array after its end. The old behaviour can lead to dirty data being copied after
160
- the end of the array (but still in the same storage slot).
161
- This causes differences in some contracts, for example:
162
-
163
- .. code-block :: solidity
164
-
165
- // SPDX-License-Identifier: GPL-3.0
166
- pragma solidity >=0.8.1;
167
-
168
- contract C {
169
- bytes x;
170
- function f() public returns (uint r) {
171
- bytes memory m = "tmp";
172
- assembly {
173
- mstore(m, 8)
174
- mstore(add(m, 32), "deadbeef15dead")
175
- }
176
- x = m;
177
- assembly {
178
- r := sload(x.slot)
179
- }
180
- }
181
- }
182
-
183
- Previously ``f() `` would return ``0x6465616462656566313564656164000000000000000000000000000000000010 ``
184
- (it has correct length, and correct first 8 elements, but then it contains dirty data which was set via assembly).
185
- Now it is returning ``0x6465616462656566000000000000000000000000000000000000000000000010 `` (it has
186
- correct length, and correct elements, but does not contain superfluous data).
187
-
188
157
.. index :: ! evaluation order; expression
189
158
190
159
- For the old code generator, the evaluation order of expressions is unspecified.
0 commit comments