solidity/test/libsolidity/semanticTests/viaYul/copy_struct_invalid_ir_bug.sol

27 lines
403 B
Solidity
Raw Normal View History

contract C {
struct Struct {
function () external el;
}
Struct[] array;
int externalCalled = 0;
function ext() external {
externalCalled++;
}
function f() public {
array.push(Struct(this.ext));
array.push(array[0]);
array[0].el();
array[1].el();
assert(externalCalled == 2);
}
}
// ----
// f() ->
2022-05-23 10:54:18 +00:00
// gas irOptimized: 112999
// gas legacy: 112931
// gas legacyOptimized: 112602