mirror of
https://github.com/ethereum/solidity
synced 2023-10-03 13:03:40 +00:00
Fix use of uninitialized functions stored in storage.
This commit is contained in:
+23
@@ -0,0 +1,23 @@
|
||||
contract C {
|
||||
|
||||
function() internal storedFn;
|
||||
|
||||
bool flag;
|
||||
|
||||
constructor() public {
|
||||
if (!flag) {
|
||||
flag = true;
|
||||
function() internal invalid;
|
||||
storedFn = invalid;
|
||||
storedFn();
|
||||
}
|
||||
}
|
||||
function f() public pure {}
|
||||
}
|
||||
contract Test {
|
||||
function f() public {
|
||||
new C();
|
||||
}
|
||||
}
|
||||
// ----
|
||||
// f() -> FAILURE
|
||||
Reference in New Issue
Block a user