mirror of
https://github.com/ethereum/solidity
synced 2023-10-03 13:03:40 +00:00
Stored combined creation and runtime tags.
Includes a change to Assembly to allow tags from sub-assemblies to be used. Sorry, this get a bit bigger than I thought.
This commit is contained in:
@@ -26,6 +26,29 @@ using namespace std;
|
||||
using namespace dev;
|
||||
using namespace dev::eth;
|
||||
|
||||
AssemblyItem AssemblyItem::toSubAssemblyTag(size_t _subId) const
|
||||
{
|
||||
assertThrow(m_data < (u256(1) << 64), Exception, "Tag already has subassembly set.");
|
||||
|
||||
assertThrow(m_type == PushTag || m_type == Tag, Exception, "");
|
||||
AssemblyItem r = *this;
|
||||
r.m_type = PushTag;
|
||||
r.setPushTagSubIdAndTag(_subId, size_t(m_data));
|
||||
return r;
|
||||
}
|
||||
|
||||
pair<size_t, size_t> AssemblyItem::splitForeignPushTag() const
|
||||
{
|
||||
assertThrow(m_type == PushTag || m_type == Tag, Exception, "");
|
||||
return make_pair(size_t(m_data / (u256(1) << 64)) - 1, size_t(m_data));
|
||||
}
|
||||
|
||||
void AssemblyItem::setPushTagSubIdAndTag(size_t _subId, size_t _tag)
|
||||
{
|
||||
assertThrow(m_type == PushTag || m_type == Tag, Exception, "");
|
||||
setData(_tag + ((u256(_subId) + 1) << 64));
|
||||
}
|
||||
|
||||
unsigned AssemblyItem::bytesRequired(unsigned _addressLength) const
|
||||
{
|
||||
switch (m_type)
|
||||
|
||||
Reference in New Issue
Block a user