Merge pull request #6822 from ethereum/uninitializedLoadFromStorage

Explicitly turn uninitialized internal function pointers into invalid function when loaded from storage.
This commit is contained in:
chriseth
2019-05-28 11:48:56 +02:00
committed by GitHub
3 changed files with 41 additions and 0 deletions
+6
View File
@@ -206,6 +206,12 @@ void StorageItem::retrieveValue(SourceLocation const&, bool _remove) const
CompilerUtils(m_context).splitExternalFunctionType(false);
cleaned = true;
}
else if (fun->kind() == FunctionType::Kind::Internal)
{
m_context << Instruction::DUP1 << Instruction::ISZERO;
CompilerUtils(m_context).pushZeroValue(*fun);
m_context << Instruction::MUL << Instruction::OR;
}
}
if (!cleaned)
{