aboutsummaryrefslogtreecommitdiffstats
path: root/Types.cpp
diff options
context:
space:
mode:
authorChristian <c@ethdev.com>2014-12-03 00:53:25 +0800
committerChristian <c@ethdev.com>2014-12-03 00:58:44 +0800
commit24f3a4a2ea22d4b9a6098a86016f1c5edfbd714d (patch)
tree63c599c5a7025936c2a6b10b324c8f0538584230 /Types.cpp
parent3fc2708d657525162567b663a07cf8cb5b1c59aa (diff)
downloaddexon-solidity-24f3a4a2ea22d4b9a6098a86016f1c5edfbd714d.tar.gz
dexon-solidity-24f3a4a2ea22d4b9a6098a86016f1c5edfbd714d.tar.zst
dexon-solidity-24f3a4a2ea22d4b9a6098a86016f1c5edfbd714d.zip
Fix: Storage offset of first struct member should be zero.
Diffstat (limited to 'Types.cpp')
-rw-r--r--Types.cpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/Types.cpp b/Types.cpp
index b81fbbe3..7e07b116 100644
--- a/Types.cpp
+++ b/Types.cpp
@@ -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."));
}