solidity/test/libsolidity/semanticTests/uninitializedFunctionPointer/invalidStoredInConstructor.sol
2022-05-19 20:23:28 +02:00

26 lines
374 B
Solidity

contract C {
function() internal storedFn;
bool flag;
constructor() {
if (!flag) {
flag = true;
function() internal invalid;
storedFn = invalid;
storedFn();
}
}
function f() public pure {}
}
contract Test {
function f() public {
new C();
}
}
// ====
// compileToEwasm: also
// ----
// f() -> FAILURE, hex"4e487b71", 0x51