diff options
author | chriseth <c@ethdev.com> | 2017-02-14 22:41:07 +0800 |
---|---|---|
committer | chriseth <c@ethdev.com> | 2017-02-14 22:41:25 +0800 |
commit | 24197a2b3f7f94dac03b6ac30802069011cf036c (patch) | |
tree | 4d55b7973fc25594b1ac7f3308d6e1181e34fed1 | |
parent | 58849cb1d52c88daeb15ec34d19ef0dc143c0a33 (diff) | |
download | dexon-solidity-24197a2b3f7f94dac03b6ac30802069011cf036c.tar dexon-solidity-24197a2b3f7f94dac03b6ac30802069011cf036c.tar.gz dexon-solidity-24197a2b3f7f94dac03b6ac30802069011cf036c.tar.bz2 dexon-solidity-24197a2b3f7f94dac03b6ac30802069011cf036c.tar.lz dexon-solidity-24197a2b3f7f94dac03b6ac30802069011cf036c.tar.xz dexon-solidity-24197a2b3f7f94dac03b6ac30802069011cf036c.tar.zst dexon-solidity-24197a2b3f7f94dac03b6ac30802069011cf036c.zip |
Assembly printing fixes.
-rw-r--r-- | libsolidity/inlineasm/AsmPrinter.cpp | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/libsolidity/inlineasm/AsmPrinter.cpp b/libsolidity/inlineasm/AsmPrinter.cpp index 66cf39c0..ab2a03ff 100644 --- a/libsolidity/inlineasm/AsmPrinter.cpp +++ b/libsolidity/inlineasm/AsmPrinter.cpp @@ -52,9 +52,7 @@ string AsmPrinter::operator()(assembly::Literal const& _literal) if (c == '\\') out += "\\\\"; else if (c == '"') - out += "\\"; - else if (c == '\'') - out += "\\'"; + out += "\\\""; else if (c == '\b') out += "\\b"; else if (c == '\f') @@ -70,7 +68,7 @@ string AsmPrinter::operator()(assembly::Literal const& _literal) else if (!isprint(c, locale::classic())) { ostringstream o; - o << std::hex << setfill('0') << setw(2) << unsigned(c); + o << std::hex << setfill('0') << setw(2) << (unsigned)(unsigned char)(c); out += "\\x" + o.str(); } else @@ -86,7 +84,7 @@ string AsmPrinter::operator()(assembly::Identifier const& _identifier) string AsmPrinter::operator()(assembly::FunctionalInstruction const& _functionalInstruction) { return - (*this)(_functionalInstruction.instruction); + + (*this)(_functionalInstruction.instruction) + "(" + boost::algorithm::join( _functionalInstruction.arguments | boost::adaptors::transformed(boost::apply_visitor(*this)), @@ -116,6 +114,8 @@ string AsmPrinter::operator()(assembly::VariableDeclaration const& _variableDecl string AsmPrinter::operator()(Block const& _block) { + if (_block.statements.empty()) + return "{\n}"; string body = boost::algorithm::join( _block.statements | boost::adaptors::transformed(boost::apply_visitor(*this)), "\n" |