Commit Graph

112 Commits

Author SHA1 Message Date
Alex Beregszaszi
581aace501 LLL: do not allow empty variable names 2017-06-22 23:00:22 +01:00
chriseth
0868a50eb1 Merge pull request #2440 from ethereum/lll-include
LLL: better error reporting in (include)
2017-06-22 17:18:34 +02:00
benjaminion
0175008ffa 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.
2017-06-22 13:46:52 +01:00
chriseth
de7a488f82 Merge pull request #2415 from benjaminion/lll-fix-create-macro
LLL: Fix for edge case in the create macros.
2017-06-22 12:33:45 +02:00
chriseth
1c54ce2a2c Merge pull request #2399 from ethereum/lll-if
LLL: Replace obsolete assembly code
2017-06-22 12:22:28 +02:00
Alex Beregszaszi
a14a1254ca LLL: report errors if (include) failed 2017-06-22 10:56:58 +01:00
benjaminion
ff8de3e9fa LLL: Fix for edge case in the create macros.
When (msize) is initially zero the previous create commands failed due to the "lll"
expression overwriting the memory at 0x00. This fix "reserves" memory location 0x00
before calling msize. If msize is already 32 or greater it has no effect.
2017-06-22 09:44:34 +01:00
benjaminion
6cab6b6f49 LLL: Correctly label arguments to ecrecover built-in macro.
(r s v hash) -> (hash v r s) which corresponds to the order that the built-in EVM contract uses.
2017-06-21 23:32:47 +01:00
Alex Beregszaszi
bc95da354d Replace obsolete assembly code in LLL 2017-06-21 21:23:39 +01:00
Alex Beregszaszi
c08c4b8b6f Move subroutine helpers from CompilerContext to Assembly 2017-06-14 21:21:26 +01:00
Alex Beregszaszi
6a260a9ff1 Remove single use Assembly::popTo 2017-06-14 21:21:26 +01:00
Alex Beregszaszi
18fc667658 Remove obsolete Assembly::out 2017-06-14 21:21:26 +01:00
Alex Beregszaszi
600e3ad240 Support shl/shr in LLL 2017-06-14 14:08:28 +01:00
benjaminion
3299c479b6 LLL: fix handling of "sha3" expression
When PR #2317 changed the EVM opcode from SHA3 to KECCAK256 it broke the `(sha3 loc len)` expression in LLL. This PR fixes things while allowing existing code using the sha3 expression (such as the ENS registrar) to continue to compile.  I.e. both `(keccak256 loc len)` and `(sha3 loc len)` may be used, and the existing related sha3 macros continue to work.

Three end-to-end test cases have been added for kekkac256 and sha3.
2017-06-13 22:20:14 +01:00
benjaminion
c603369a51 Change opcode generated by (panic) to INVALID
EIP-141 ethereum/EIPs#141 has preserved 0xfe as an invalid opcode for aborting EVM execution. The EVM assembler supports this via the INVALID opcode.

The LLL "panic" expression used to generate a jump to an invalid location in order to abort EVM execution.  This change brings "panic" into line with EIP-141 by generating the INVALID opcode instead.
2017-06-13 17:01:38 +01:00
Yoichi Hirai
37a949e634
liblll: allow macros with no arguments 2017-06-12 15:16:08 +02:00
Alex Beregszaszi
902f69640b Replace cpp-ethereum with solidity in the license headers 2017-02-02 10:06:28 +00:00
Alex Beregszaszi
b1add657b7 LLL: throw exceptions on invalid symbols 2016-11-30 16:17:50 +00:00
Alex Beregszaszi
99b803cbcb LLL: () requires at least one parameter 2016-11-30 16:17:50 +00:00
Alex Beregszaszi
a8696c6d8e LLL: do not accept '0x' as 0 2016-11-30 16:17:50 +00:00
Alex Beregszaszi
53d4433484 LLL: simplify error handling in parseLLL 2016-11-30 15:06:13 +00:00
Alex Beregszaszi
d82eac3fed LLL: parseLLL to be less greedy catching exceptions 2016-11-29 22:04:51 +00:00
Alex Beregszaszi
3ec0bb5bfa LLL: parseLLL to return empty string on failure 2016-11-29 21:42:22 +00:00
Alex Beregszaszi
4a67a2862c Merge pull request #1329 from ethereum/lll-lit-changes
LLL: improvements (and fixes) to the lit keyword
2016-11-26 15:22:14 +00:00
Alex Beregszaszi
eee10f1af2 LLL: simplify the LIT parsing code 2016-11-26 14:41:15 +00:00
chriseth
e51f852504 Converted sub assembly to smart pointer. 2016-11-16 14:37:18 +01:00
chriseth
e543bd34c0 Stored combined creation and runtime tags.
Includes a change to Assembly to allow tags from sub-assemblies to be
used.

Sorry, this get a bit bigger than I thought.
2016-11-16 14:37:18 +01:00
chriseth
7a30e8cf6e Merge pull request #1252 from ethereum/jsoncpp-from-source
Build jsoncpp from source using jsoncpp.cmake script
2016-11-08 13:47:52 +01:00
Alex Beregszaszi
200cbc08dd LLL: add bytecodesize keyword to push resulting bytecode size 2016-11-01 22:19:06 +00:00
Alex Beregszaszi
ac3c8a553a LLL: properly support dashes (-) as part of variable names 2016-11-01 10:45:13 +00:00
Alex Beregszaszi
dc5e05681d LLL: simplify integer parsing 2016-11-01 10:45:13 +00:00
Alex Beregszaszi
b92bb41be7 LLL: catch and display spirit::qi errors 2016-11-01 01:08:57 +00:00
Alex Beregszaszi
5be1996ea5 LLL: update exception message 2016-10-31 23:19:32 +00:00
Alex Beregszaszi
b24eed1c3e LLL: remove unneeded includes 2016-10-31 23:19:32 +00:00
Alex Beregszaszi
9b65a79cb3 LLL: report back unsupported keywords 2016-10-31 23:19:32 +00:00
Alex Beregszaszi
b269202b73 LLL: support passing error reasons 2016-10-31 23:19:32 +00:00
Alex Beregszaszi
75b1ae8910 LLL: only support variable length bigendian numbers in LIT 2016-10-31 23:17:55 +00:00
Alex Beregszaszi
6d97a56af1 LLL: support multiple strings in LIT 2016-10-31 23:17:48 +00:00
chriseth
e85390cc60 Merge pull request #1302 from ethereum/lll-panic
LLL: introduce panic keyword
2016-10-28 11:44:46 +02:00
Alex Beregszaszi
274c76fc5e LLL: introduce panic keyword 2016-10-27 13:45:33 +01:00
Daniel Ellison
7ac53f5305 Added support for until, the inverse of while. 2016-10-26 09:24:01 -04:00
Alex Beregszaszi
6cb9c36977 LLL: reorder arithmetic/binary instruction list for readability 2016-10-26 01:16:29 +01:00
Alex Beregszaszi
ee3cfd8f52 LLL: use NOT for ~ 2016-10-26 01:12:15 +01:00
Alex Beregszaszi
5a981b59c3 LLL: replace (1 0 sub) with literal value 2016-10-26 01:10:55 +01:00
Paweł Bylica
4bde0a2d36 Build jsoncpp from source using jsoncpp.cmake script 2016-10-20 22:18:13 +01:00
chriseth
0fd6f2b5a6 Merge pull request #1228 from ethereum/lll-units-parser
LLL: move broken parsing of Ethereum subunits to macros
2016-10-19 10:26:21 +02:00
Alex Beregszaszi
27fca416ba LLL: add Ethereum subunit macros 2016-10-15 16:26:04 +01:00
Alex Beregszaszi
3a91da27ed LLL: remove Ethereum subunits from the parser 2016-10-15 14:48:43 +01:00
Alex Beregszaszi
8aa50a004f LLL: throw proper ParserException 2016-10-15 13:26:16 +01:00
Alex Beregszaszi
7c7a6de87b LLL: fix the commented out debugging code 2016-10-15 12:58:57 +01:00
Alex Beregszaszi
e5efc86f2d LLL: better error reporting 2016-10-15 02:27:54 +01:00
Daniel Ellison
00278fdea8 Removed obsolete built in macros. Added a new macro to support the use of 'keccak256' in addition to 'sha3'. 2016-10-13 10:03:54 -04:00
chriseth
4c54834908 Rename libevmasm. 2016-08-10 13:52:24 +02:00
chriseth
7ea5770598 Do not install headers. 2016-08-05 16:35:24 +02:00
Paweł Bylica
ca6a21bcd3 Suppress a warning in LLL parser on MSVC 2015 2016-05-13 15:38:23 +02:00
chriseth
6f54b13d7a Remove log.h from solidity. 2016-04-12 01:03:46 +02:00
Dimitry
d43d4347bf return instructionInfo style 2016-04-04 15:27:09 +04:00
Dimitry
858c41260d rename namespace for instruction.h/cpp in libevmasm 2016-04-02 15:56:43 +03:00
Dimitry
ccbd3ff63f move libevmcore to solidity 2016-04-01 23:11:01 +03:00
chriseth
79167aa897 Move libevmasm and lll. 2016-03-23 23:10:10 +01:00
Dimitry
2851967dac includes 2016-03-22 16:05:27 +04:00
Dimitry
e95dd9203a move liblll 2016-03-21 14:58:34 +03:00