diff options
author | Alex Beregszaszi <alex@rtfs.hu> | 2016-11-01 07:17:09 +0800 |
---|---|---|
committer | Alex Beregszaszi <alex@rtfs.hu> | 2016-11-01 07:17:55 +0800 |
commit | 75b1ae89102d1f917b59b3fa67046181cd74aa7e (patch) | |
tree | 58ed4e8106c9f96bdcbbe9a48d5d4fbb0960cf92 /liblll | |
parent | 6d97a56af17d65425d72c5df973b2fa4fac74a7a (diff) | |
download | dexon-solidity-75b1ae89102d1f917b59b3fa67046181cd74aa7e.tar.gz dexon-solidity-75b1ae89102d1f917b59b3fa67046181cd74aa7e.tar.zst dexon-solidity-75b1ae89102d1f917b59b3fa67046181cd74aa7e.zip |
LLL: only support variable length bigendian numbers in LIT
Diffstat (limited to 'liblll')
-rw-r--r-- | liblll/CodeFragment.cpp | 15 |
1 files changed, 2 insertions, 13 deletions
diff --git a/liblll/CodeFragment.cpp b/liblll/CodeFragment.cpp index f143ca43..1bf587ce 100644 --- a/liblll/CodeFragment.cpp +++ b/liblll/CodeFragment.cpp @@ -297,21 +297,10 @@ void CodeFragment::constructOperation(sp::utree const& _t, CompilerState& _s) bigint bi = *i.get<bigint*>(); if (bi < 0) error<IntegerOutOfRange>(); - else if (bi > bigint(u256(0) - 1)) - { - if (ii == 2 && _t.size() == 3) - { - // One big int - allow it as hex. - data.resize(bytesRequired(bi)); - toBigEndian(bi, data); - } - else - error<IntegerOutOfRange>(); - } else { - data.resize(data.size() + 32); - *(h256*)(&data.back() - 31) = (u256)bi; + bytes tmp = toCompactBigEndian(bi); + data.insert(data.end(), tmp.begin(), tmp.end()); } } else if (ii) |