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

26 lines
373 B
Solidity
Raw Normal View History

contract C {
function() internal storedFn;
bool flag;
2020-06-23 12:14:24 +00:00
constructor() {
if (!flag) {
flag = true;
function() internal invalid;
storedFn = invalid;
storedFn();
}
}
function f() public pure {}
}
contract Test {
function f() public {
new C();
}
}
2020-11-24 16:02:02 +00:00
// ====
// compileViaYul: also
// ----
2020-10-13 11:28:39 +00:00
// f() -> FAILURE, hex"4e487b71", 0x51