Merge pull request #12557 from nishant-sachdeva/adding_stack_height_checker_to_address_provider_in_case_type_function

Adding Stack Height Checker and modifying the number of POP instructions
This commit is contained in:
Daniel Kirchner
2022-01-19 21:18:15 +01:00
committed by GitHub
4 changed files with 38 additions and 2 deletions
@@ -0,0 +1,25 @@
contract C {
function g() external {}
function h() external payable {}
function test_function() external returns (bool){
assert (
this.g.address == this.g.address &&
this.g{gas: 42}.address == this.g.address &&
this.g{gas: 42}.selector == this.g.selector
);
assert (
this.h.address == this.h.address &&
this.h{gas: 42}.address == this.h.address &&
this.h{gas: 42}.selector == this.h.selector
);
assert (
this.h{gas: 42, value: 5}.address == this.h.address &&
this.h{gas: 42, value: 5}.selector == this.h.selector
);
return true;
}
}
// ====
// compileViaYul: also
// ----
// test_function() -> true
@@ -0,0 +1,8 @@
contract C {
function f (address) external returns (bool) {
this.f{gas: 42}.address;
}
}
// ----
// Warning 6321: (56-60): Unnamed return variable can remain unassigned. Add an explicit return with value to all non-reverting code paths or name the variable.
// Warning 2018: (17-102): Function state mutability can be restricted to view