aboutsummaryrefslogtreecommitdiffstats
path: root/CompilerUtils.cpp
diff options
context:
space:
mode:
authorLefteris Karapetsas <lefteris@refu.co>2015-03-05 23:54:55 +0800
committerLefteris Karapetsas <lefteris@refu.co>2015-03-12 19:53:00 +0800
commit7d7f37bd5e1221243729edbd6ef8d19fd2ce13eb (patch)
treebde3b768ecc216aed8ac272405e475644a98b8f4 /CompilerUtils.cpp
parentbede2f2ad7eb023018ab2faac17286fdee82b03c (diff)
downloaddexon-solidity-7d7f37bd5e1221243729edbd6ef8d19fd2ce13eb.tar.gz
dexon-solidity-7d7f37bd5e1221243729edbd6ef8d19fd2ce13eb.tar.zst
dexon-solidity-7d7f37bd5e1221243729edbd6ef8d19fd2ce13eb.zip
Replacing StaticStringType with FixedBytesType
Diffstat (limited to 'CompilerUtils.cpp')
-rw-r--r--CompilerUtils.cpp7
1 files changed, 4 insertions, 3 deletions
diff --git a/CompilerUtils.cpp b/CompilerUtils.cpp
index 8a26b5d1..e11b6b4f 100644
--- a/CompilerUtils.cpp
+++ b/CompilerUtils.cpp
@@ -177,8 +177,9 @@ void CompilerUtils::computeHashStatic(Type const& _type, bool _padToWordBoundari
unsigned CompilerUtils::loadFromMemoryHelper(Type const& _type, bool _fromCalldata, bool _padToWordBoundaries)
{
- unsigned numBytes = _type.getCalldataEncodedSize(_padToWordBoundaries);
- bool leftAligned = _type.getCategory() == Type::Category::String;
+ unsigned _encodedSize = _type.getCalldataEncodedSize();
+ unsigned numBytes = _padToWordBoundaries ? getPaddedSize(_encodedSize) : _encodedSize;
+ bool leftAligned = _type.getCategory() == Type::Category::FixedBytes;
if (numBytes == 0)
m_context << eth::Instruction::POP << u256(0);
else
@@ -202,7 +203,7 @@ unsigned CompilerUtils::loadFromMemoryHelper(Type const& _type, bool _fromCallda
unsigned CompilerUtils::prepareMemoryStore(Type const& _type, bool _padToWordBoundaries) const
{
unsigned numBytes = _type.getCalldataEncodedSize(_padToWordBoundaries);
- bool leftAligned = _type.getCategory() == Type::Category::String;
+ bool leftAligned = _type.getCategory() == Type::Category::FixedBytes;
if (numBytes == 0)
m_context << eth::Instruction::POP;
else