solidity/test/libsolidity/semanticTests/uninitializedFunctionPointer/storeInConstructor.sol

23 lines
393 B
Solidity
Raw Normal View History

contract InvalidTest {
function() internal storedFn;
bool flag;
2020-06-23 12:14:24 +00:00
constructor() {
function() internal invalid;
storedFn = invalid;
}
function f() public returns (uint) {
if (flag) return 2;
flag = true;
storedFn();
}
}
// ====
// compileViaYul: also
// compileToEwasm: also
// ----
2020-10-13 11:28:39 +00:00
// f() -> FAILURE, hex"4e487b71", 0x51
// f() -> FAILURE, hex"4e487b71", 0x51