mirror of
https://github.com/ethereum/solidity
synced 2023-10-03 13:03:40 +00:00
Fix: Storage offset of first struct member should be zero.
This commit is contained in:
parent
3fc2708d65
commit
24f3a4a2ea
@ -295,9 +295,9 @@ u256 StructType::getStorageOffsetOfMember(string const& _name) const
|
||||
u256 offset;
|
||||
for (ASTPointer<VariableDeclaration> variable: m_struct.getMembers())
|
||||
{
|
||||
offset += variable->getType()->getStorageSize();
|
||||
if (variable->getName() == _name)
|
||||
return offset;
|
||||
offset += variable->getType()->getStorageSize();
|
||||
}
|
||||
BOOST_THROW_EXCEPTION(InternalCompilerError() << errinfo_comment("Storage offset of non-existing member requested."));
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user