solidity/test/libsolidity/semanticTests/uninitializedFunctionPointer/storeInConstructor.sol
2023-05-11 10:56:55 -05:00

20 lines
338 B
Solidity

contract InvalidTest {
function() internal storedFn;
bool flag;
constructor() {
function() internal invalid;
storedFn = invalid;
}
function f() public returns (uint) {
if (flag) return 2;
flag = true;
storedFn();
}
}
// ----
// f() -> FAILURE, hex"4e487b71", 0x51
// f() -> FAILURE, hex"4e487b71", 0x51