aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAlex Beregszaszi <alex@rtfs.hu>2016-10-26 08:12:15 +0800
committerAlex Beregszaszi <alex@rtfs.hu>2016-10-26 08:12:15 +0800
commitee3cfd8f528c9c950ab416b22d34ddfee978f999 (patch)
tree2c3e7de9ce4e6bc971a564ddcb1cb3b4f16da6c3
parent5a981b59c3519257027a107898c06693c126c7b5 (diff)
downloaddexon-solidity-ee3cfd8f528c9c950ab416b22d34ddfee978f999.tar.gz
dexon-solidity-ee3cfd8f528c9c950ab416b22d34ddfee978f999.tar.zst
dexon-solidity-ee3cfd8f528c9c950ab416b22d34ddfee978f999.zip
LLL: use NOT for ~
-rw-r--r--liblll/CodeFragment.cpp11
1 files changed, 1 insertions, 10 deletions
diff --git a/liblll/CodeFragment.cpp b/liblll/CodeFragment.cpp
index 02351c3f..ce3024f6 100644
--- a/liblll/CodeFragment.cpp
+++ b/liblll/CodeFragment.cpp
@@ -332,7 +332,7 @@ void CodeFragment::constructOperation(sp::utree const& _t, CompilerState& _s)
std::map<std::string, Instruction> const c_arith = { { "+", Instruction::ADD }, { "-", Instruction::SUB }, { "*", Instruction::MUL }, { "/", Instruction::DIV }, { "%", Instruction::MOD }, { "&", Instruction::AND }, { "|", Instruction::OR }, { "^", Instruction::XOR } };
std::map<std::string, pair<Instruction, bool>> const c_binary = { { "<", { Instruction::LT, false } }, { "<=", { Instruction::GT, true } }, { ">", { Instruction::GT, false } }, { ">=", { Instruction::LT, true } }, { "S<", { Instruction::SLT, false } }, { "S<=", { Instruction::SGT, true } }, { "S>", { Instruction::SGT, false } }, { "S>=", { Instruction::SLT, true } }, { "=", { Instruction::EQ, false } }, { "!=", { Instruction::EQ, true } } };
- std::map<std::string, Instruction> const c_unary = { { "!", Instruction::ISZERO } };
+ std::map<std::string, Instruction> const c_unary = { { "!", Instruction::ISZERO }, { "~", Instruction::NOT } };
vector<CodeFragment> code;
CompilerState ns = _s;
@@ -541,15 +541,6 @@ void CodeFragment::constructOperation(sp::utree const& _t, CompilerState& _s)
// At end now.
m_asm.append(end);
}
- else if (us == "~")
- {
- requireSize(1);
- requireDeposit(0, 1);
-
- m_asm.append(code[0].m_asm, 1);
- m_asm.append(bigint(u256(0) - 1);
- m_asm.append(Instruction::SUB);
- }
else if (us == "SEQ")
{
unsigned ii = 0;