Disallow RETURNDATASIZE and RETURNDATACOPY in inline assembly blocks in pure functions

(cherry picked from commit f567eb1fb2)

quick fix to pass failing test at ./test/externalTests/ens.sh (line 80) -- Should be removed when 0.9 is released.
This commit is contained in:
Kamil Śliwak
2022-05-20 09:31:27 -03:00
committed by Matheus Aguiar
parent 00fb31c8cc
commit 7f4f655cca
10 changed files with 44 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
// ----