mirror of
https://github.com/ethereum/solidity
synced 2023-10-03 13:03:40 +00:00
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:
+25
@@ -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
|
||||
+8
@@ -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
|
||||
Reference in New Issue
Block a user