aboutsummaryrefslogtreecommitdiffstats
path: root/liblll/CompilerState.cpp
diff options
context:
space:
mode:
authorbenjaminion <ben@edginet.org>2017-06-22 20:18:54 +0800
committerbenjaminion <ben@edginet.org>2017-06-22 20:46:52 +0800
commit0175008ffaaeecf1d110ef55f736f8ce45ffe90f (patch)
treee0f9959974eef531fcbf70c3fac8bc6a35c57999 /liblll/CompilerState.cpp
parentf823952d9f0cc1e37dec465111db976c7a1830b2 (diff)
downloaddexon-solidity-0175008ffaaeecf1d110ef55f736f8ce45ffe90f.tar
dexon-solidity-0175008ffaaeecf1d110ef55f736f8ce45ffe90f.tar.gz
dexon-solidity-0175008ffaaeecf1d110ef55f736f8ce45ffe90f.tar.bz2
dexon-solidity-0175008ffaaeecf1d110ef55f736f8ce45ffe90f.tar.lz
dexon-solidity-0175008ffaaeecf1d110ef55f736f8ce45ffe90f.tar.xz
dexon-solidity-0175008ffaaeecf1d110ef55f736f8ce45ffe90f.tar.zst
dexon-solidity-0175008ffaaeecf1d110ef55f736f8ce45ffe90f.zip
LLL: Fix msg macro with six arguments.
The previous macro used the set built-in in a way incompatible with the current implementation of set. This commit updates the macro to be more transparent in how it's working and avoids the use of the set and alloc built-ins.
Diffstat (limited to 'liblll/CompilerState.cpp')
-rw-r--r--liblll/CompilerState.cpp3
1 files changed, 2 insertions, 1 deletions
diff --git a/liblll/CompilerState.cpp b/liblll/CompilerState.cpp
index 72078535..5d38bb8c 100644
--- a/liblll/CompilerState.cpp
+++ b/liblll/CompilerState.cpp
@@ -49,7 +49,8 @@ void CompilerState::populateStandard()
"(def 'allgas (- (gas) 21))"
"(def 'send (to value) (call allgas to value 0 0 0 0))"
"(def 'send (gaslimit to value) (call gaslimit to value 0 0 0 0))"
- "(def 'msg (gaslimit to value data datasize outsize) { (set x outsize) (set y (alloc @32)) (call gaslimit to value data datasize @0 @32) @0 })"
+ // NOTE: in this macro, memory location 0 is set in order to force msize to be at least 32 bytes.
+ "(def 'msg (gaslimit to value data datasize outsize) { [0]:0 [0]:(msize) (call gaslimit to value data datasize @0 outsize) @0 })"
"(def 'msg (gaslimit to value data datasize) { (call gaslimit to value data datasize 0 32) @0 })"
"(def 'msg (gaslimit to value data) { [0]:data (msg gaslimit to value 0 32) })"
"(def 'msg (to value data) { [0]:data (msg allgas to value 0 32) })"