aboutsummaryrefslogtreecommitdiffstats
path: root/CompilerUtils.cpp
diff options
context:
space:
mode:
authorchriseth <c@ethdev.com>2015-06-25 20:52:13 +0800
committerchriseth <c@ethdev.com>2015-06-25 20:52:59 +0800
commitb5672d5ae09ac0315949b2a0d9e7f728282a6e68 (patch)
tree92060326a64939a9770aa946639f4611c8941870 /CompilerUtils.cpp
parent2d169748b7b80079d78c0197a773bebd46189175 (diff)
downloaddexon-solidity-b5672d5ae09ac0315949b2a0d9e7f728282a6e68.tar
dexon-solidity-b5672d5ae09ac0315949b2a0d9e7f728282a6e68.tar.gz
dexon-solidity-b5672d5ae09ac0315949b2a0d9e7f728282a6e68.tar.bz2
dexon-solidity-b5672d5ae09ac0315949b2a0d9e7f728282a6e68.tar.lz
dexon-solidity-b5672d5ae09ac0315949b2a0d9e7f728282a6e68.tar.xz
dexon-solidity-b5672d5ae09ac0315949b2a0d9e7f728282a6e68.tar.zst
dexon-solidity-b5672d5ae09ac0315949b2a0d9e7f728282a6e68.zip
Simplify static memory access functions.
Diffstat (limited to 'CompilerUtils.cpp')
-rw-r--r--CompilerUtils.cpp13
1 files changed, 5 insertions, 8 deletions
diff --git a/CompilerUtils.cpp b/CompilerUtils.cpp
index 5bd6de13..e763a394 100644
--- a/CompilerUtils.cpp
+++ b/CompilerUtils.cpp
@@ -91,13 +91,11 @@ void CompilerUtils::loadFromMemoryDynamic(
}
}
-unsigned CompilerUtils::storeInMemory(unsigned _offset, Type const& _type, bool _padToWordBoundaries)
+void CompilerUtils::storeInMemory(unsigned _offset)
{
- solAssert(_type.getCategory() != Type::Category::Array, "Unable to statically store dynamic type.");
- unsigned numBytes = prepareMemoryStore(_type, _padToWordBoundaries);
+ unsigned numBytes = prepareMemoryStore(IntegerType(256), true);
if (numBytes > 0)
m_context << u256(_offset) << eth::Instruction::MSTORE;
- return numBytes;
}
void CompilerUtils::storeInMemoryDynamic(Type const& _type, bool _padToWordBoundaries)
@@ -599,11 +597,10 @@ unsigned CompilerUtils::getSizeOnStack(vector<shared_ptr<Type const>> const& _va
return size;
}
-void CompilerUtils::computeHashStatic(Type const& _type, bool _padToWordBoundaries)
+void CompilerUtils::computeHashStatic()
{
- unsigned length = storeInMemory(0, _type, _padToWordBoundaries);
- solAssert(length <= CompilerUtils::freeMemoryPointer, "");
- m_context << u256(length) << u256(0) << eth::Instruction::SHA3;
+ storeInMemory(0);
+ m_context << u256(32) << u256(0) << eth::Instruction::SHA3;
}
unsigned CompilerUtils::loadFromMemoryHelper(Type const& _type, bool _fromCalldata, bool _padToWordBoundaries)