Adding Stack Height Checker and modifying the number of POP instructions to appropriately provide the pointer address

This commit is contained in:
nishant-sachdeva
2022-01-20 01:15:08 +05:30
parent c3c5937bd7
commit 27d0480e96
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