Control flow side-effects for user-defined functions.

This commit is contained in:
chriseth
2021-10-14 17:46:07 +02:00
parent d443fe415d
commit 9417d6775f
20 changed files with 637 additions and 32 deletions
@@ -0,0 +1,34 @@
{
function a() {
if calldataload(0) { g() }
}
function b() {
g()
if calldataload(0) { }
}
function c() {
if calldataload(0) { }
g()
}
function d() {
stop()
if calldataload(0) { g() }
}
function e() {
if calldataload(0) { g() }
stop()
}
function f() {
g()
if calldataload(0) { g() }
}
function g() { revert(0, 0) }
}
// ----
// a: can revert, can continue
// b: can revert
// c: can revert
// d: can terminate
// e: can terminate, can revert
// f: can revert
// g: can revert
@@ -0,0 +1,17 @@
{
function a() {}
function f() { g() }
function g() { revert(0, 0) }
function h() { stop() }
function i() { h() }
function j() { h() g() }
function k() { g() h() }
}
// ----
// a: can continue
// f: can revert
// g: can revert
// h: can terminate
// i: can terminate
// j: can terminate
// k: can revert