Make verbatim compatible with KnownState.

This commit is contained in:
chriseth
2021-04-26 19:56:44 +02:00
parent e2d8005737
commit cb1af8b88a
11 changed files with 48 additions and 19 deletions
+6 -2
View File
@@ -92,7 +92,7 @@ size_t AssemblyItem::bytesRequired(size_t _addressLength) const
else
return 1 + (3 + 32) * 1024; // 1024 occurrences are beyond the maximum code size anyways.
case VerbatimBytecode:
return m_verbatimBytecode->second.size();
return std::get<2>(*m_verbatimBytecode).size();
default:
break;
}
@@ -103,6 +103,8 @@ size_t AssemblyItem::arguments() const
{
if (type() == Operation)
return static_cast<size_t>(instructionInfo(instruction()).args);
else if (type() == VerbatimBytecode)
return get<0>(*m_verbatimBytecode);
else if (type() == AssignImmutable)
return 2;
else
@@ -128,6 +130,8 @@ size_t AssemblyItem::returnValues() const
return 1;
case Tag:
return 0;
case VerbatimBytecode:
return get<1>(*m_verbatimBytecode);
default:
break;
}
@@ -244,7 +248,7 @@ string AssemblyItem::toAssemblyText(Assembly const& _assembly) const
assertThrow(false, AssemblyException, "Invalid assembly item.");
break;
case VerbatimBytecode:
text = string("verbatimbytecode_") + util::toHex(m_verbatimBytecode->second);
text = string("verbatimbytecode_") + util::toHex(get<2>(*m_verbatimBytecode));
break;
default:
assertThrow(false, InvalidOpcode, "");