diff options
author | Alex Beregszaszi <alex@rtfs.hu> | 2017-05-03 01:26:33 +0800 |
---|---|---|
committer | Alex Beregszaszi <alex@rtfs.hu> | 2017-05-19 16:44:16 +0800 |
commit | edd0afa3c35475990bacd8ffe64d15b3be40a036 (patch) | |
tree | 43fe277a01e28007a5de2aada0d6a338aa0fa697 /libsolidity/inlineasm/AsmPrinter.cpp | |
parent | cc9a99a63fdfbcb0ea9bfb444688a6d094e37b11 (diff) | |
download | dexon-solidity-edd0afa3c35475990bacd8ffe64d15b3be40a036.tar.gz dexon-solidity-edd0afa3c35475990bacd8ffe64d15b3be40a036.tar.zst dexon-solidity-edd0afa3c35475990bacd8ffe64d15b3be40a036.zip |
Support true/false literals in inline assembly
Diffstat (limited to 'libsolidity/inlineasm/AsmPrinter.cpp')
-rw-r--r-- | libsolidity/inlineasm/AsmPrinter.cpp | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/libsolidity/inlineasm/AsmPrinter.cpp b/libsolidity/inlineasm/AsmPrinter.cpp index f3b66aee..636e61b8 100644 --- a/libsolidity/inlineasm/AsmPrinter.cpp +++ b/libsolidity/inlineasm/AsmPrinter.cpp @@ -46,8 +46,16 @@ string AsmPrinter::operator()(assembly::Instruction const& _instruction) string AsmPrinter::operator()(assembly::Literal const& _literal) { - if (_literal.isNumber) + switch (_literal.kind) + { + case LiteralKind::Number: return _literal.value + appendTypeName(_literal.type); + case LiteralKind::Boolean: + return ((_literal.value == "true") ? "true" : "false") + appendTypeName(_literal.type); + case LiteralKind::String: + break; + } + string out; for (char c: _literal.value) if (c == '\\') |