From f0d213e6b56da5be8088008bf2ceadb7fd0030f7 Mon Sep 17 00:00:00 2001 From: Alex Beregszaszi Date: Mon, 29 May 2017 23:50:46 +0100 Subject: Introduce MachineAssemblyObject --- solc/CommandLineInterface.cpp | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) (limited to 'solc') diff --git a/solc/CommandLineInterface.cpp b/solc/CommandLineInterface.cpp index b2e257ee..e755c3b5 100644 --- a/solc/CommandLineInterface.cpp +++ b/solc/CommandLineInterface.cpp @@ -1082,9 +1082,10 @@ bool CommandLineInterface::assemble( "eWasm"; cout << endl << "======= " << src.first << " (" << machine << ") =======" << endl; AssemblyStack& stack = assemblyStacks[src.first]; + MachineAssemblyObject object; try { - cout << stack.assemble(_targetMachine).toHex() << endl; + object = stack.assemble(_targetMachine); } catch (Exception const& _exception) { @@ -1096,6 +1097,10 @@ bool CommandLineInterface::assemble( cerr << "Unknown exception while assembling." << endl; return false; } + if (object.bytecode) + cout << object.bytecode->toHex() << endl; + else + cerr << "No binary representation found." << endl; cout << stack.print() << endl; } -- cgit v1.2.3