Disallow RETURNDATASIZE and RETURNDATACOPY in inline assembly blocks in pure functions

This commit is contained in:
Kamil Śliwak
2022-04-08 14:48:35 +02:00
parent fb7c969ce8
commit f567eb1fb2
9 changed files with 41 additions and 34 deletions
@@ -1,5 +1,5 @@
contract C {
function f() pure external {
function f() view external {
assembly {
let s := returndatasize()
returndatacopy(0, 0, s)
@@ -1,5 +1,5 @@
contract C {
function f() pure external {
function f() view external {
assembly {
let s := returndatasize()
returndatacopy(0, 0, s)
@@ -1,5 +1,5 @@
contract C {
function f() public pure {
function f() public view {
uint returndatasize;
returndatasize;
assembly {
@@ -1,5 +1,5 @@
contract C {
function f() public pure {
function f() public view {
uint returndatasize;
returndatasize;
assembly {
@@ -1,4 +1,4 @@
contract C { function f() public pure { uint returndatasize; returndatasize; assembly { pop(returndatasize()) }}}
contract C { function f() public view { uint returndatasize; returndatasize; assembly { pop(returndatasize()) }}}
// ====
// EVMVersion: =homestead
// ----