mirror of
https://github.com/ethereum/solidity
synced 2023-10-03 13:03:40 +00:00
Introduce address(...).code
This commit is contained in:
@@ -0,0 +1,19 @@
|
||||
contract A {
|
||||
constructor() {
|
||||
assembly {
|
||||
// This is only 7 bytes here.
|
||||
mstore(0, 0x48aa5566000000)
|
||||
return(0, 32)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
contract C {
|
||||
function f() public returns (bytes memory) { return address(new A()).code; }
|
||||
function g() public returns (uint) { return address(new A()).code.length; }
|
||||
}
|
||||
// ====
|
||||
// compileViaYul: false
|
||||
// ----
|
||||
// f() -> 0x20, 0x20, 0x48aa5566000000
|
||||
// g() -> 0x20
|
||||
Reference in New Issue
Block a user