Commit Graph

894 Commits

Author SHA1 Message Date
chriseth
cb7021881a Whiskers template system 2017-06-22 16:56:57 +02:00
chriseth
9eaf26a359 Check for address-like strings being treated as addresses. 2017-06-22 16:48:44 +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
benjaminion
9954c5c0fa LLL: Testcases for the two create built-in macros. 2017-06-22 09:45:23 +01:00
Federico Bond
0f8ad1d68f Fix segmentation fault with constant function parameters 2017-06-21 22:46:27 -03:00
benjaminion
35bf91407e LLL: Test case for ecrecover built-in macro. 2017-06-21 23:35:27 +01:00
Alex Beregszaszi
3515ee98ff Add tests for when/unless/if in LLL 2017-06-21 21:23:20 +01:00
chriseth
b3a7b5a145 Merge pull request #2416 from federicobond/multiple-specifiers
Display error if payable or constant is specified multiple times
2017-06-19 12:00:04 +02:00
chriseth
0c75afb2c1 Merge pull request #2225 from ethereum/julia-for
Implement for statement in assembly parser / printer / code generator
2017-06-19 11:53:22 +02:00
Federico Bond
d170ceaf3d Display error if payable or constant is specified multiple times 2017-06-17 12:21:46 -03:00
Alex Beregszaszi
d7e63f23de Fix UTF-8 validation for high codepoints (>10000) 2017-06-16 16:41:29 +02:00
Alex Beregszaszi
c5339037e9 Test for variable redeclaration in for loops 2017-06-16 11:30:03 +01:00
chriseth
0fd73e5832 Fix test. 2017-06-16 11:29:41 +01:00
chriseth
ea0a86a995 Some more parsing tests. 2017-06-16 11:29:35 +01:00
chriseth
2f0826ffd7 Functionality tests for for. 2017-06-16 10:56:21 +01:00
chriseth
1b3ba7bc57 Some more tests. 2017-06-16 10:56:21 +01:00
Alex Beregszaszi
47925bc14e Parse for statement in assembly parser / printer 2017-06-16 10:56:21 +01:00
chriseth
fb5db94879 Merge pull request #2397 from ethereum/doublepush
Peephole optimizer for double push.
2017-06-15 10:50:07 +02:00
chriseth
7af9d10006 Fix lll test. 2017-06-15 10:07:17 +02:00
chriseth
66881bd675 Merge branch 'develop' into asm-aux 2017-06-15 08:39:02 +02:00
Alex Beregszaszi
42b61171d9 Merge pull request #2192 from winsvega/develop
add STATICCALL instruction
2017-06-14 21:03:32 +01:00
Alex Beregszaszi
3c4671a2da Match substring in tests to avoid metadata issues 2017-06-14 20:31:20 +01:00
Alex Beregszaszi
585b3ea3e3 Print auxiliary data in the assembly 2017-06-14 20:14:15 +01:00
chriseth
e5b0ad562e Peephole optimizer for double push. 2017-06-14 20:02:45 +02:00
chriseth
f008ddf836 Merge pull request #2381 from ethereum/fixcrash
Fix a crash about a non-callable expression.
2017-06-14 18:35:38 +02:00
chriseth
fd5bf16101 Merge pull request #2384 from ethereum/parseFunctionalInstructions
Enforce function arguments when parsing functional instructions.
2017-06-14 18:35:16 +02:00
Dimitry
c20cdd0a05 add new opcode instructions to the parser
STATICCALL        0xfa  6 inputs  (gas address mem1 mem2 mem3 mem4)
2017-06-14 18:18:12 +02:00
chriseth
d693822a6f Merge pull request #2394 from ethereum/lll-shifts
Support shl/shr in LLL
2017-06-14 18:04:40 +02:00
chriseth
2b3b00776e Additional test. 2017-06-14 16:06:48 +02:00
chriseth
1ae0e082b3 Merge pull request #2392 from federicobond/disallow-trailing-commas
Forbid trailing commas in named arguments
2017-06-14 15:31:40 +02:00
Alex Beregszaszi
600e3ad240 Support shl/shr in LLL 2017-06-14 14:08:28 +01:00
chriseth
1b1f35762e Enforce function arguments when parsing functional instructions. 2017-06-14 14:51:47 +02:00
chriseth
21aafaa704 Merge pull request #2331 from ethereum/ASTDocumentationEntry
documentation field added to ContractDefinition-Node
2017-06-14 14:32:27 +02:00
chriseth
07cc84fade Fix a crash about a non-callable expression. 2017-06-14 14:26:20 +02:00
Federico Bond
fd8365df08 Forbid trailing commas in named arguments 2017-06-14 00:15:27 -03: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
Yoichi Hirai
8775e77305
Add a warning about a varialbe of the name of an instruction 2017-06-13 16:57:08 +02:00
Yoichi Hirai
a7241df4b7
Add a failing test as suggested in
https://github.com/ethereum/solidity/pull/2275#discussion_r121438333
2017-06-13 16:57:08 +02:00
Yoichi Hirai
a0f8c94dad
Add a test about checking a warning 2017-06-13 16:57:08 +02:00
Yoichi Hirai
464dea2459
test: Add different styles of returndatacopy and returndatasize 2017-06-13 16:57:08 +02:00
Yoichi Hirai
0b22154a75
libevmasm: add RETURNDATACOPY and RETURNDATASIZE 2017-06-13 16:57:02 +02:00
Yoichi Hirai
c4f0608b68
More informative test 2017-06-13 12:28:03 +02:00
Yoichi Hirai
0909ffc26e
Fix the expectation about the parse 2017-06-13 12:21:28 +02:00
Yoichi Hirai
a03913427f
Add an end-to-end test about LLL macro with zero arguments 2017-06-12 15:16:08 +02:00
Yoichi Hirai
b86b084bc6
Add a test that fails about an LLL macro with no arguments 2017-06-12 15:16:03 +02:00
chriseth
bf2b5c746a Use lowercase when reporting instruction error. 2017-06-09 15:17:29 +02:00
Alex Beregszaszi
80227af08a Add test for two functions calling eachother 2017-06-09 10:46:13 +01:00
chriseth
b098b363b5 Test for embedded functions. 2017-06-08 15:52:45 +02:00
chriseth
b75c7b5775 Move inline assembly to new abstraction and test both backends. 2017-06-08 15:52:45 +02:00
chriseth
64ddb176bb Test for accessing outer inline assembly scope. 2017-06-08 15:52:45 +02:00
chriseth
97cc968a13 Initial EVM1.5 assembly implementation. 2017-06-08 15:52:44 +02:00
djudjuu
83f0e00900 tests for non-legacy mode 2017-06-07 15:52:44 +02:00
djudjuu
ebdebc7c12 new test case and indentation fix 2017-06-06 15:47:30 +02:00
chriseth
1fba984966 Merge pull request #2332 from ethereum/fixLiteralPrint
fix Literalprint
2017-06-06 15:09:48 +02:00
djudjuu
62eafdd010 adjusted testcase and renaming 2017-06-06 13:26:23 +02:00
chriseth
d4a57d81ba Merge pull request #2317 from ethereum/keccak256
Use keccak256 in tests and replace the SHA3 instruction in assembly
2017-05-30 19:34:28 +02:00
djudjuu
b011ddfae3 adjusted test-cases 2017-05-30 19:25:54 +02:00
Rhett Aultman
89b60ffbd4 Refactor error reporting
This commit introduces ErrorReporter, a utility class which consolidates
all of the error logging functionality into a common set of functions.
It also replaces all direct interactions with an ErrorList with calls to
an ErrorReporter.

This commit resolves issue #2209
2017-05-30 07:28:31 -07:00
Alex Beregszaszi
dcb7c51920 Add inline assembly test for sha3/keccak256 2017-05-30 13:57:44 +01:00
Alex Beregszaszi
ff33297786 Add test for sha3() == keccak256() 2017-05-30 12:33:04 +01:00
Alex Beregszaszi
9e1c509cf5 Use keccak256() in tests (and not sha3()) 2017-05-30 12:33:04 +01:00
Alex Beregszaszi
0c8beac357 Rename the SHA3 assembly instruction to KECCAK256 2017-05-30 10:54:29 +01:00
Alex Beregszaszi
efadf7e41f Change error message for invalid type 2017-05-26 20:42:17 +01:00
Alex Beregszaszi
8fe79fe706 Introduce Julia mode in AsmAnalyzer 2017-05-26 20:39:30 +01:00
Alex Beregszaszi
3b75c5b45f Validate that only basic types are used in Julia 2017-05-26 20:39:10 +01:00
Alex Beregszaszi
98c9051174 Fix expected message in test case 2017-05-26 11:16:12 +01:00
chriseth
ec676ba9f2 Merge pull request #2224 from ethereum/julia-switch
Implement switch statement in the assembly parser/printer
2017-05-26 11:24:38 +02:00
Alex Beregszaszi
05fcf1989c Better error messages for invalid switch cases 2017-05-26 03:20:34 +01:00
Alex Beregszaszi
c64bd33784 Disallow instructions as a switch expression 2017-05-26 03:20:34 +01:00
Alex Beregszaszi
0c5c1ca911 Add tests 2017-05-26 03:20:34 +01:00
Alex Beregszaszi
7600a814fa Enable the analyzer for Julia tests 2017-05-25 01:28:47 +01:00
Alex Beregszaszi
338202ea96 Uniform error messages 2017-05-24 13:35:52 +01:00
Alex Beregszaszi
130f7419fb Add tests 2017-05-24 13:35:52 +01:00
Alex Beregszaszi
4612c7681c Validate metadata JSON too 2017-05-24 12:24:00 +01:00
Alex Beregszaszi
804e99c633 Split out metadata test into its own file 2017-05-24 12:24:00 +01:00
Alex Beregszaszi
fb46268982 Add tests 2017-05-23 10:24:19 +01:00
chriseth
74d2e7311a Merge pull request #2265 from roadriverrail/inline_asm_unused_warning
Analyze InlineAssembly for variable use
2017-05-22 16:34:29 +02:00
chriseth
8eead553af Merge pull request #1810 from ethereum/compactJson
Compact format for AST-Json.
2017-05-22 14:33:46 +02:00
Rhett Aultman
621c3fa22f Analyze InlineAssembly for variable use
The unused variable checker in StaticAnalyzer did not conssider
InlineAssembly objects.  This commit introduces that missing feature.
2017-05-21 15:23:05 -07:00
chriseth
e2b21e1c96 Refactor to abstract assembly to JULIA. 2017-05-19 19:20:28 +02:00
chriseth
41ee2cefbb Merge pull request #2282 from ethereum/fuzzer
Display the source on which the 'fuzzer' failed
2017-05-19 18:32:50 +02:00
chriseth
6d1252f807 Put filename in quotes. 2017-05-19 17:58:07 +02:00
chriseth
56424bb202 Merge pull request #2262 from ethereum/interface-cleanup
Cleanup the external interfaces (ABI and Natspec)
2017-05-19 17:55:33 +02:00
chriseth
982f661339 Merge pull request #2223 from ethereum/julia-bool
Add support for bool literals in Julia
2017-05-19 17:48:36 +02:00
Alex Beregszaszi
cd5d93da2a Rename CompilerStack.metadata to CompilerStack.natspec 2017-05-19 16:11:04 +01:00
Alex Beregszaszi
4bf3cbb09a Use CompilerStack.contractABI directly 2017-05-19 15:57:36 +01:00
chriseth
21ba8eea69 Disable error checking by bash for fuzzer 2017-05-19 15:30:35 +01:00
Alex Beregszaszi
56412b11b3 Display the source on which the 'fuzzer' failed 2017-05-19 15:30:35 +01:00
Alex Beregszaszi
2ade4fcdd8 Add tests for bool literal 2017-05-19 09:44:16 +01:00
djudjuu
6316a76ab9 testsuite adjustment 2017-05-19 09:51:23 +02:00
seusher
d546c2873a Issue 2279: Log JSON RPC requests and responses when --log_level=message is provided to soltest 2017-05-17 12:57:55 -07:00
chriseth
dea7b864e6 Compact format for AST-Json with backwards compatibility 2017-05-17 11:14:33 +02:00
chriseth
d9b5ff0b43 Merge pull request #2222 from ethereum/julia-types
Add support for types in Julia
2017-05-16 16:59:15 +02:00
Yoichi Hirai
9dac41d845
Remove an unused function successAssemble
Otherwise, I see a build failure:
    test/libjulia/Parser.cpp:92:6: error: ‘bool dev::solidity::test::{anonymous}::successAssemble(const string&, bool)’ defined but not used [-Werror=unused-function]
     bool successAssemble(string const& _source, bool _allowWarnings = true)
          ^~~~~~~~~~~~~~~
    cc1plus: all warnings being treated as errors
2017-05-09 11:51:16 +02:00
Alex Beregszaszi
41b5361b3f Run in optimizer mode when requested 2017-05-06 11:28:46 +01:00
Alex Beregszaszi
31bd4acf66 Split out common metadata validation code 2017-05-06 11:28:01 +01:00
Alex Beregszaszi
c4315521a3 Add basic test for jsonCompiler 2017-05-06 11:28:01 +01:00
Alex Beregszaszi
6706932d7c Add tests for types in Julia 2017-05-05 22:31:22 +01:00