Commit Graph

88 Commits

Author SHA1 Message Date
Alex Beregszaszi
15517b571d lll: disallow useless PUSHn in assembly 2017-10-13 02:04:36 +01:00
Alex Beregszaszi
ab206b8113 LLL: do not crash if import callback is null 2017-10-03 10:22:30 +01:00
Alex Beregszaszi
26f3ea8cf7 LLL: change (include) to use a callback 2017-10-02 21:19:36 +01:00
Alex Beregszaszi
cbd4465a7f lll: do not expose push/dup/swap/jumpdest as functions 2017-10-02 16:21:21 +01:00
Alex Beregszaszi
6cbb726fb8 Merge pull request #2622 from benjaminion/lll-switch
LLL: Implement a "switch" expression
2017-10-02 13:38:21 +01:00
benjaminion
326c7887a4 LLL: Implement a switch expression. 2017-10-02 12:01:15 +01:00
Alex Beregszaszi
cddfec27ee lll: better error reporting in some cases 2017-10-02 11:48:26 +01:00
Alex Beregszaszi
bbfb16cf5c Introduce assemblyString 2017-09-11 15:53:20 +01:00
Alex Beregszaszi
a535a8b06e Split out the JSON functionality from assembly.stream() 2017-09-11 15:48:52 +01:00
Alex Beregszaszi
3b07c4d38e Merge pull request #2757 from ethereum/cmake
Static linking
2017-08-23 12:36:24 +01:00
Paweł Bylica
388fc983fa
CMake: Cleanup "local" include path 2017-08-22 22:50:25 +02:00
Alex Beregszaszi
9897c56b2c Mark a lot of functions static (where possible) 2017-08-22 10:51:46 +01:00
Alex Beregszaszi
e2cfc9ee92 Mark a lot of functions const (where possible) 2017-08-22 10:51:46 +01:00
Paweł Bylica
99d198ffb0
CMake: Make libs dependencies explicit 2017-08-21 12:27:06 +02:00
Paweł Bylica
7337054d8e
CMake: Simplify liblll config 2017-08-18 13:32:35 +02:00
Paweł Bylica
d1f4d110fb
CMake: Build static libs by default 2017-08-18 13:32:35 +02:00
Alex Beregszaszi
d70974ea7c Merge pull request #2573 from benjaminion/lll-error-report-symbol
LLL: Improve error reporting in certain cases.
2017-07-20 11:02:31 +01:00
Yoichi Hirai
3ad326beba Merge pull request #2592 from ethereum/lll-simplify
LLL: remove useless code
2017-07-19 11:47:21 +02:00
Alex Beregszaszi
fa2781d6da LLL: remove useless code 2017-07-18 21:12:43 +01:00
Alex Beregszaszi
c880550fbc LLL: disable optimiser entirely if requested 2017-07-18 21:09:05 +01:00
benjaminion
4c0953385e LLL: Improve error reporting in certain cases. 2017-07-15 22:17:20 +01:00
benjaminion
3bc935d932 LLL: rewrite alloc to avoid issues with edge cases. 2017-07-11 21:22:38 +01:00
Alex Beregszaszi
dbbdcc66e6 LLL: fix redefinitions on some compilers 2017-06-24 12:59:30 +01:00
Alex Beregszaszi
b46bb70b96 LLL: remove obsolete header 2017-06-23 02:52:44 +01:00
Alex Beregszaszi
af57c083f2 LLL: fix the set keyword (create symbol if not present) 2017-06-23 02:52:44 +01:00
Alex Beregszaszi
1ffe286a81 LLL: report correct name if a symbol was not found 2017-06-22 23:00:22 +01:00
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