mirror of
https://github.com/ethereum/solidity
synced 2023-10-03 13:03:40 +00:00
Support .offset and .length for calldata bytes and string arrays.
This commit is contained in:
@@ -0,0 +1,12 @@
|
||||
contract C {
|
||||
function f(uint[2][] calldata x) public returns (uint o, uint l, uint s) {
|
||||
assembly { l := x.length o := x.offset }
|
||||
uint[2] calldata t = x[1];
|
||||
// statically-sized arrays only use one slot, so we read directly.
|
||||
assembly { s := t }
|
||||
}
|
||||
}
|
||||
// ====
|
||||
// compileViaYul: also
|
||||
// ----
|
||||
// f(uint256[2][]): 0x20, 2, 1, 2, 3, 4 -> 0x44, 2, 0x84
|
||||
Reference in New Issue
Block a user