aboutsummaryrefslogtreecommitdiffstats
path: root/libevmasm/Assembly.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'libevmasm/Assembly.cpp')
-rw-r--r--libevmasm/Assembly.cpp7
1 files changed, 4 insertions, 3 deletions
diff --git a/libevmasm/Assembly.cpp b/libevmasm/Assembly.cpp
index 7f7e1b9c..450ee6ce 100644
--- a/libevmasm/Assembly.cpp
+++ b/libevmasm/Assembly.cpp
@@ -123,7 +123,7 @@ ostream& Assembly::streamAsm(ostream& _out, string const& _prefix, StringMap con
_out << " " << instructionInfo(i.instruction()).name << "\t" << i.getJumpTypeAsString();
break;
case Push:
- _out << " PUSH " << hex << i.data();
+ _out << " PUSH" << dec << max<unsigned>(1, dev::bytesRequired(i.data())) << " 0x" << hex << i.data();
break;
case PushString:
_out << " PUSH \"" << m_strings.at((h256)i.data()) << "\"";
@@ -296,7 +296,7 @@ AssemblyItem const& Assembly::append(AssemblyItem const& _i)
AssemblyItem Assembly::newPushLibraryAddress(string const& _identifier)
{
- h256 h(dev::sha3(_identifier));
+ h256 h(dev::keccak256(_identifier));
m_libraries[h] = _identifier;
return AssemblyItem(PushLibraryAddress, h);
}
@@ -322,7 +322,8 @@ Assembly& Assembly::optimise(bool _enable, bool _isCreation, size_t _runs)
count++;
{
- ControlFlowGraph cfg(m_items);
+ // Control flow graph that resets knowledge at path joins.
+ ControlFlowGraph cfg(m_items, false);
AssemblyItems optimisedItems;
for (BasicBlock const& block: cfg.optimisedBlocks())
{