2020-03-09 21:14:07 +00:00
|
|
|
contract C {
|
|
|
|
modifier m {
|
|
|
|
uint256 a = 1;
|
|
|
|
assembly {
|
|
|
|
a := 2
|
|
|
|
}
|
|
|
|
if (a != 2) revert();
|
|
|
|
_;
|
|
|
|
}
|
|
|
|
|
|
|
|
function f() public m returns (bool) {
|
|
|
|
return true;
|
|
|
|
}
|
2020-11-26 22:08:06 +00:00
|
|
|
|
|
|
|
modifier n {
|
|
|
|
uint256 a = 1;
|
|
|
|
assembly {
|
|
|
|
a := 2
|
|
|
|
}
|
|
|
|
if (a != 2)
|
|
|
|
_;
|
|
|
|
revert();
|
|
|
|
}
|
|
|
|
|
|
|
|
function g() public n returns (bool) {
|
|
|
|
// This statement should never execute.
|
|
|
|
return true;
|
|
|
|
}
|
2020-03-09 21:14:07 +00:00
|
|
|
}
|
|
|
|
|
2020-11-30 17:59:49 +00:00
|
|
|
// ====
|
|
|
|
// compileViaYul: also
|
2021-04-23 15:59:01 +00:00
|
|
|
// compileToEwasm: also
|
2020-03-09 21:14:07 +00:00
|
|
|
// ----
|
|
|
|
// f() -> true
|
2020-11-26 22:08:06 +00:00
|
|
|
// g() -> FAILURE
|