aboutsummaryrefslogtreecommitdiffstats
path: root/liblll
diff options
context:
space:
mode:
authorchriseth <chris@ethereum.org>2017-06-22 18:33:45 +0800
committerGitHub <noreply@github.com>2017-06-22 18:33:45 +0800
commitde7a488f82217118d698f4cd6028826f12cbad8b (patch)
tree32a18ee19b687b058b9e3aea1683158d62be1c82 /liblll
parent1c54ce2a2caa6c4d91091152ad8a52b7881e8b83 (diff)
parent9954c5c0faccdf56ba11ab90438cfa6b1cdcd4b4 (diff)
downloaddexon-solidity-de7a488f82217118d698f4cd6028826f12cbad8b.tar.gz
dexon-solidity-de7a488f82217118d698f4cd6028826f12cbad8b.tar.zst
dexon-solidity-de7a488f82217118d698f4cd6028826f12cbad8b.zip
Merge pull request #2415 from benjaminion/lll-fix-create-macro
LLL: Fix for edge case in the create macros.
Diffstat (limited to 'liblll')
-rw-r--r--liblll/CompilerState.cpp5
1 files changed, 3 insertions, 2 deletions
diff --git a/liblll/CompilerState.cpp b/liblll/CompilerState.cpp
index c76ef655..72078535 100644
--- a/liblll/CompilerState.cpp
+++ b/liblll/CompilerState.cpp
@@ -54,8 +54,9 @@ void CompilerState::populateStandard()
"(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) })"
"(def 'msg (to data) { [0]:data (msg allgas to 0 0 32) })"
- "(def 'create (value code) { [0]:(msize) (create value @0 (lll code @0)) })"
- "(def 'create (code) { [0]:(msize) (create 0 @0 (lll code @0)) })"
+ // NOTE: in the create macros, memory location 0 is set in order to force msize to be at least 32 bytes.
+ "(def 'create (value code) { [0]:0 [0]:(msize) (create value @0 (lll code @0)) })"
+ "(def 'create (code) { [0]:0 [0]:(msize) (create 0 @0 (lll code @0)) })"
"(def 'sha3 (loc len) (keccak256 loc len))"
"(def 'sha3 (val) { [0]:val (sha3 0 32) })"
"(def 'sha3pair (a b) { [0]:a [32]:b (sha3 0 64) })"