mirror of
https://github.com/ethereum/solidity
synced 2023-10-03 13:03:40 +00:00
Disallow codecopy and codesize in pure functions.
This commit is contained in:
@@ -1,7 +1,7 @@
|
||||
contract C {
|
||||
function f() public pure {
|
||||
assembly {
|
||||
switch codesize()
|
||||
switch calldatasize()
|
||||
case hex"00" {}
|
||||
case hex"1122" {}
|
||||
}
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
contract C {
|
||||
function f() public pure {
|
||||
assembly {
|
||||
switch codesize()
|
||||
switch calldatasize()
|
||||
case "1" {}
|
||||
case "2" {}
|
||||
}
|
||||
|
||||
@@ -26,5 +26,11 @@ contract C {
|
||||
function l() public view {
|
||||
assembly { pop(extcodesize(0)) }
|
||||
}
|
||||
function m() public view {
|
||||
assembly { codecopy(0,0,0) }
|
||||
}
|
||||
function n() public view {
|
||||
assembly { pop(codesize()) }
|
||||
}
|
||||
}
|
||||
// ----
|
||||
|
||||
Reference in New Issue
Block a user