mirror of
https://github.com/ethereum/solidity
synced 2023-10-03 13:03:40 +00:00
Fixed bug that added a superfluous empty slot for data when encoding an empty string coming from storage.
Added tests covering empty string, uninitialized string, emptry string literal, byte arrays and explicit call to `abi.encode`.
This commit is contained in:
1 parent
de7daaa2af
commit
33ea6a679d
10 files changed
+110
-9
No files matched your search
@@ -699,7 +699,7 @@ string ABIFunctions::abiEncodingFunctionCompactStorageArray(
|
||||
case 0 {
|
||||
// short byte array
|
||||
mstore(pos, and(slotValue, not(0xff)))
|
||||
ret := add(pos, <lengthPaddedShort>)
|
||||
ret := add(pos, mul(<lengthPaddedShort>, iszero(iszero(length))))
|
||||
}
|
||||
case 1 {
|
||||
// long byte array
|
||||
|
||||
Reference in new issue
Block a user