mirror of
https://github.com/ethereum/solidity
synced 2023-10-03 13:03:40 +00:00
Control flow side-effects for user-defined functions.
This commit is contained in:
@@ -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
|
||||
Reference in New Issue
Block a user