aboutsummaryrefslogtreecommitdiffstats
path: root/libsolidity/inlineasm/AsmCodeGen.cpp
diff options
context:
space:
mode:
authorAlex Beregszaszi <alex@rtfs.hu>2017-05-03 01:26:33 +0800
committerAlex Beregszaszi <alex@rtfs.hu>2017-05-19 16:44:16 +0800
commitedd0afa3c35475990bacd8ffe64d15b3be40a036 (patch)
tree43fe277a01e28007a5de2aada0d6a338aa0fa697 /libsolidity/inlineasm/AsmCodeGen.cpp
parentcc9a99a63fdfbcb0ea9bfb444688a6d094e37b11 (diff)
downloaddexon-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/AsmCodeGen.cpp')
-rw-r--r--libsolidity/inlineasm/AsmCodeGen.cpp9
1 files changed, 8 insertions, 1 deletions
diff --git a/libsolidity/inlineasm/AsmCodeGen.cpp b/libsolidity/inlineasm/AsmCodeGen.cpp
index 137a70f5..44e12b3e 100644
--- a/libsolidity/inlineasm/AsmCodeGen.cpp
+++ b/libsolidity/inlineasm/AsmCodeGen.cpp
@@ -118,8 +118,15 @@ public:
void operator()(assembly::Literal const& _literal)
{
m_state.assembly.setSourceLocation(_literal.location);
- if (_literal.isNumber)
+ if (_literal.kind == assembly::LiteralKind::Number)
m_state.assembly.append(u256(_literal.value));
+ else if (_literal.kind == assembly::LiteralKind::Boolean)
+ {
+ if (_literal.value == "true")
+ m_state.assembly.append(u256(1));
+ else
+ m_state.assembly.append(u256(0));
+ }
else
{
solAssert(_literal.value.size() <= 32, "");