This commit is contained in:
chriseth 2021-10-04 18:09:08 +02:00
parent 9417d6775f
commit 2c2269d300
5 changed files with 165 additions and 0 deletions

View File

@ -0,0 +1,19 @@
{
function a() -> x {
revert(0, 0)
}
function b() -> x {
return(0, 0)
}
function c() {
sstore(a(), b())
}
function d() {
sstore(b(), a())
}
}
// ----
// a: can revert
// b: can terminate
// c: can terminate
// d: can revert

View File

@ -0,0 +1,55 @@
{
function a() {
for { leave } calldataload(0) { } {
break
revert(0, 0)
}
}
function b() {
for { } calldataload(0) { leave } {
break
revert(0, 0)
}
}
function b2() {
for { } calldataload(0) { leave } {
revert(0, 0)
}
}
function c() {
for { } calldataload(0) { revert(0, 0) } {
break
}
}
function c2() {
for { } calldataload(0) { revert(0, 0) } {
break
revert(0, 0)
}
}
function d() {
for { } calldataload(0) { revert(0, 0) } {
continue
}
}
function e() {
for { } calldataload(0) { revert(0, 0) } {
if calldataload(1) { break }
}
}
function f() {
for { } calldataload(0) { } {
if calldataload(1) { continue }
revert(0, 0)
}
}
}
// ----
// a: can continue
// b: can continue
// b2: can revert, can continue
// c: can continue
// c2: can continue
// d: can revert, can continue
// e: can revert, can continue
// f: can revert, can continue

View File

@ -0,0 +1,13 @@
{
function a() {
revert(0, 0)
leave
}
function b() {
leave
revert(0, 0)
}
}
// ----
// a: can revert
// b: can continue

View File

@ -0,0 +1,37 @@
{
function a() {
if calldataload(0) {
revert(0, 0)
}
reg()
b()
}
function b() {
a()
return(0, 0)
}
function c() {
c()
revert(0, 0)
}
function d() {
switch calldataload(0)
case 0 { x() }
case 1 { y() reg() revert(0, 0) }
default { z() }
}
function x() { d() revert(0, 0) }
function y() { reg() x() }
function z() { y() }
function reg() {}
}
// ----
// a: can revert
// b: can revert
// c:
// d:
// reg: can continue
// x:
// y:
// z:

View File

@ -0,0 +1,41 @@
{
function a() {
switch calldataload(0)
case 0 { revert(0, 0) }
}
function b() {
switch calldataload(0)
case 0 { revert(0, 0) }
default { revert(0, 0) }
}
function c() {
return(0, 0)
switch calldataload(0)
case 0 { revert(0, 0) }
default { }
}
function d() {
switch calldataload(0)
case 0 { return(0, 0) }
default { return(0, 0) }
revert(0, 0)
}
function e() {
switch calldataload(0)
case 0 { return(0, 0) }
revert(0, 0)
}
function f() {
switch calldataload(0)
case 0 { leave }
default { leave }
revert(0, 0)
}
}
// ----
// a: can revert, can continue
// b: can revert
// c: can terminate
// d: can terminate
// e: can terminate, can revert
// f: can continue