Commit Graph

1272 Commits

Author SHA1 Message Date
Alex Beregszaszi
74d41ad25f Fix scope assert in AsmAnalyzer 2017-05-24 11:58:49 +01:00
Alex Beregszaszi
b77b11781d Rename parseFunctionalInstruction to parseCall 2017-05-24 01:48:54 +01:00
Alex Beregszaszi
4f738ff1c0 Reorder AsmData for readability 2017-05-24 01:48:54 +01:00
Alex Beregszaszi
187fa50751 Rename FunctionalAssignment to Assignment 2017-05-24 01:48:53 +01:00
Alex Beregszaszi
f15d6ea45f Rename Assignment to StackAssignment 2017-05-24 01:07:07 +01:00
Alex Beregszaszi
604d254e8c Fix AST JSON converter type lookup 2017-05-23 23:12:40 +01:00
Alex Beregszaszi
e9b106cd0e Merge pull request #2292 from roadriverrail/inline_asm_unused_warning
Drop the inline asm includes from StaticAnalyzer
2017-05-23 23:11:03 +01:00
Rhett Aultman
f735207732 Drop the inline asm includes from StaticAnalyzer 2017-05-23 06:38:17 -07:00
Alex Beregszaszi
3451a30e5c Display actual error message and not assertion in analysis 2017-05-22 18:45:34 +01:00
Alex Beregszaszi
cb4966046d Enable a single right hand item on let 2017-05-22 18:45:34 +01:00
Alex Beregszaszi
15b4d4def2 Support multiple variables in a variable declaration in inline assembly 2017-05-22 18:45:34 +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
djudjuu
e82df073d1 minor fixes and changelog update 2017-05-22 12:25:50 +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
7f5601fd4b Add const 2017-05-19 20:15:28 +02:00
chriseth
69413ae32a Review changes. 2017-05-19 20:12:12 +02:00
chriseth
e2b21e1c96 Refactor to abstract assembly to JULIA. 2017-05-19 19:20:28 +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
Alex Beregszaszi
cd5d93da2a Rename CompilerStack.metadata to CompilerStack.natspec 2017-05-19 16:11:04 +01:00
Alex Beregszaszi
81877cc594 Rename InterfaceHandler to Natspec 2017-05-19 16:11:04 +01:00
Alex Beregszaszi
12328b7848 Split ABI out of InterfaceHandler 2017-05-19 16:11:03 +01:00
Alex Beregszaszi
4bf3cbb09a Use CompilerStack.contractABI directly 2017-05-19 15:57:36 +01:00
Alex Beregszaszi
8169e149c9 Rename CompilerStack.interface to CompilerStack.contractABI 2017-05-19 15:57:36 +01:00
djudjuu
1d22233a43 refactoring functionCallAnnotation 2017-05-19 15:48:07 +02:00
Alex Beregszaszi
ebcb27e5c1 Accept bool as a type in Julia mode 2017-05-19 09:44:16 +01:00
Alex Beregszaszi
edd0afa3c3 Support true/false literals in inline assembly 2017-05-19 09:44:16 +01:00
djudjuu
6316a76ab9 testsuite adjustment 2017-05-19 09:51:23 +02:00
djudjuu
e3583d04f7 include new InlineAssemblyInformation into JSON 2017-05-17 15:58:28 +02:00
djuju
a4ba5ace8a prefixChanges and contractKind-field 2017-05-17 11:14:33 +02:00
djuju
2fa7646944 fixed styletypos, renaming and added helperfunction 2017-05-17 11:14:33 +02:00
Alex Beregszaszi
487eef18cc Use different AST node names in legacy and new format 2017-05-17 11:14:33 +02:00
Alex Beregszaszi
f2a6331ffb Support the new AST in StandardCompiler 2017-05-17 11:14:33 +02: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
Alex Beregszaszi
c0f31e4c1b Ensure proper checks are in CompilerStack 2017-05-11 08:02:03 +01:00
Alex Beregszaszi
5b4b620d8b Do not crash on AST if parsing failed 2017-05-11 08:02:03 +01:00
Erik Quenon Steggall
0489c99870 Added change to make compile happy on MacOS 10.9.5 2017-05-05 16:49:09 -07:00
Alex Beregszaszi
8688b63fa6 Use boost range adaptors in AsmPrinter 2017-05-05 22:31:22 +01:00
Alex Beregszaszi
d6396ee85f Parse types in Julia mode 2017-05-05 22:31:22 +01:00
Alex Beregszaszi
07176e82de Assert that invalid AST elements are not printed in Julia mode 2017-05-05 14:21:25 +01:00
Alex Beregszaszi
c423e140ee Add flag for JULIA printing 2017-05-05 14:21:25 +01:00
Alex Beregszaszi
804971973d Show better error message for Julia mode 2017-05-05 14:21:25 +01:00
Alex Beregszaszi
f1f209db40 Do not allow literal pushes in Julia 2017-05-05 14:21:25 +01:00
Alex Beregszaszi
d61f9c4d4e Disable labels in Julia 2017-05-05 14:21:25 +01:00
chriseth
0582fcb93b Merge pull request #2194 from ethereum/removeerrorlabel
Remove error label / invalid jump label.
2017-05-05 14:25:43 +02:00
chriseth
230f51efb7 Cleanup, style and additional test. 2017-05-03 11:26:21 +02:00
chriseth
e0266b79f3 Refactor: Combine bool and function pointer. 2017-05-03 11:26:21 +02:00
Rhett Aultman
a6faa5acf3 Treat returns with expressions as return param use
There are many cases of code where the return parameters exist mostly
as a form of documentation.  This change ensures that they do not have
to be used in the function body so long as there is a return supplying
values
2017-05-03 11:26:21 +02:00
Rhett Aultman
a40c8cfb68 Warn on unused local variables
Analyze functions for all local variables, parameters, and named
return variables which are never used in the function, and issue
a warning.
2017-05-03 11:26:21 +02:00
Alex Beregszaszi
c09f071ff6 Merge pull request #2211 from ethereum/jsonio-fixes
Follow the JSON I/O spec closely
2017-05-02 16:47:14 +01:00
Alex Beregszaszi
ed3ab3506a Follow the JSON I/O spec closely 2017-05-02 16:52:38 +02:00
chriseth
acab525fef Merge pull request #2199 from roadriverrail/no_unary_plus
Deprecate use of unary '+'
2017-05-02 16:43:47 +02:00
Alex Beregszaszi
2871663cad Remove why3 from standard compiler 2017-05-02 14:49:13 +01:00
chriseth
96870686a9 Style and stricter tests. 2017-05-02 15:48:58 +02:00
chriseth
f42a9a9408 Merge pull request #2198 from ethereum/conditionalCompilerStateReset
conditional reset of compilerState-Enum
2017-05-02 15:17:10 +02:00
chriseth
2891b98882 Merge pull request #2110 from federicobond/fix-posttypechecker
Fix PostTypeChecker retaining state across contracts
2017-05-02 12:12:46 +02:00
Rhett Aultman
e544698ad3 Deprecate use of unary '+'
The unary '+' serves no meaningful purpose in Solidity and it makes it
possible to produce typos with dagerous implications (e.g. 'a =+5 '),
so we are deprecating it.  The SyntaxChecker currently issues warnings
on the unary '+' but will still compile it for now.
2017-04-28 17:43:19 -07:00
djuju
e9954eb325 conditional reset of compilerState-Enum 2017-04-28 18:46:27 +02:00
chriseth
f33614e1f7 Merge pull request #2171 from ethereum/splitParseAndAnalyze
refactoring parse() into two separate functions
2017-04-28 17:19:31 +02:00
djuju
a6306a1d44 error fixed 2017-04-28 16:20:32 +02:00
djuju
45f8c5aa88 enumchecks not working 2017-04-28 15:24:59 +02:00
chriseth
28f10f4783 Remove error label / invalid jump label. 2017-04-28 13:14:52 +02:00
chriseth
f9bccab7b7 Merge pull request #2193 from ethereum/julia-assign-stack
Disallow assign from stack in Julia (=: var)
2017-04-27 22:00:33 +02:00
chriseth
6776be33a8 Merge pull request #2189 from ethereum/julia-instructions
Do not disallow EVM instructions as identifiers in Julia
2017-04-27 21:58:45 +02:00
Alex Beregszaszi
20206a04dd Disallow assign from stack in Julia (=: var) 2017-04-27 19:20:53 +01:00
Alex Beregszaszi
8020144d06 Do not validate identifiers against EVM instructions in JULIA 2017-04-27 18:16:42 +01:00
Alex Beregszaszi
01b60a4f8d Add flag for JULIA parsing 2017-04-27 18:16:42 +01:00
Alex Beregszaszi
b0485e327b Make assembler errors fatal 2017-04-27 16:34:57 +01:00
Alex Beregszaszi
16276ab10b Catch assembler exceptions and throw readable Solidity exceptions 2017-04-27 16:06:49 +01:00
Alex Beregszaszi
8b79517d47 Do not validate identifiers against EVM instructions in JULIA 2017-04-27 14:12:48 +01:00
Alex Beregszaszi
b48bc81d40 Add flag for JULIA parsing 2017-04-27 14:12:43 +01:00
djuju
5fd7942173 documentation, checks and renaming 2017-04-27 12:56:56 +02:00
djuju
99a7aefb75 refactoring parse() into two separate functions 2017-04-27 12:38:24 +02:00
Alex Beregszaszi
35f1cf92db Remove parentheses from around function return parameters 2017-04-27 10:08:02 +01:00
chriseth
d7b3ce24a4 Check stack height during code generation. 2017-04-26 17:12:04 +02:00
chriseth
f3ec2ba39e Refactor to combined scope and stack height info. 2017-04-26 17:12:04 +02:00
chriseth
68218387cf Store stack height in analysis phase. 2017-04-26 12:34:24 +02:00
chriseth
1d712c7d64 Fix storage access tests. 2017-04-25 16:49:04 +02:00
chriseth
e841b23bfd Special case for storage types with offset zero. 2017-04-25 16:49:04 +02:00
chriseth
3df7b06464 Pass internal resolver to assembly analyzer. 2017-04-25 16:49:04 +02:00
chriseth
0ebaf220b5 Fix refactoring error. 2017-04-25 16:49:04 +02:00
chriseth
978884d9ca Build fix. 2017-04-25 16:49:04 +02:00
chriseth
478f2997ea Storage access from inline assembly. 2017-04-25 16:49:04 +02:00
chriseth
5f4b68e211 Another stack check. 2017-04-25 16:49:04 +02:00
chriseth
dfb7d5ebd9 Move analysis out of code generator. 2017-04-25 16:49:04 +02:00
chriseth
dfaab73efe Only allow access to local variables and only if they have a stack size of one. 2017-04-25 16:49:04 +02:00
chriseth
f19e6a09a7 Check again that instruction argument count is correct. 2017-04-25 16:49:03 +02:00
chriseth
b622c2e9d3 Only run stack filler on AST elements that are or contain declarations. 2017-04-25 16:49:03 +02:00
chriseth
34717838da Review comments. 2017-04-25 16:49:03 +02:00
chriseth
83bf34c571 Review comments and cleanup. 2017-04-25 16:49:03 +02:00
chriseth
4755757c00 Remove some errors checks from code generation (was moved to analysis already). 2017-04-25 16:49:03 +02:00
chriseth
580921b329 Perform stack height checks in assembly analysis phase. 2017-04-25 16:49:03 +02:00
chriseth
c4a0826f40 Add some missing error locations. 2017-04-25 16:49:03 +02:00
chriseth
c6fa78c73e Use actual type checking phase of assembler. 2017-04-25 16:49:03 +02:00
chriseth
e0849f2f3b Split external identifier access into resolving and code generation. 2017-04-25 16:49:03 +02:00
chriseth
5d6747eb32 Refactor assembly analysis into scope filling and checking. 2017-04-25 16:49:03 +02:00
chriseth
72fdf755c9 Register functions. 2017-04-25 16:49:03 +02:00
chriseth
c3b839ca75 Merge pull request #2164 from ethereum/jsonio-catch-internal-exceptions
JSON IO catch internal exceptions
2017-04-25 10:45:59 +02:00
Alex Beregszaszi
5e7a643051 Catch jsoncpp exceptions 2017-04-24 22:49:50 +01:00
Alex Beregszaszi
2f66c69bd1 Do not crash on invalid JSON input 2017-04-24 22:38:03 +01:00
chriseth
4d111e3366 Merge pull request #2152 from ethereum/warnRevert
Warn about side-effect free statements.
2017-04-24 19:25:45 +02:00
chriseth
d3b8d5f049 Merge pull request #2161 from ethereum/jsonio-cleanup
Small cleanups to JSON IO
2017-04-24 17:12:37 +02:00
chriseth
2c3fea55df Merge pull request #2159 from ethereum/jsonio-source-verify
Verify supplied hash in JSON I/O
2017-04-24 16:15:32 +02:00
Alex Beregszaszi
4a9ba5b952 Verify supplied hash in JSON I/O 2017-04-24 14:34:29 +01:00
Alex Beregszaszi
43eb839871 Do not fail if parsing failed in StandardCompiler 2017-04-24 11:44:33 +01:00
Alex Beregszaszi
3cd02ca148 Change error type names to not include spaces 2017-04-24 11:34:02 +01:00
Alex Beregszaszi
e24c35bce0 Be a bit more verbose and capture Boost exceptions in StandardCompiler 2017-04-24 11:34:02 +01:00
Alex Beregszaszi
c82a203206 Document that the ReadFileCallback should not emit exceptions 2017-04-22 14:08:28 +01:00
chriseth
c76e0a5872 Changed const reference to value. 2017-04-22 01:12:38 +02:00
Alex Beregszaszi
8de02c7778 Support URL sources in StandardCompiler 2017-04-21 16:44:15 +01:00
chriseth
937695bfdc Change error message. 2017-04-21 15:04:03 +02:00
chriseth
9bc9fe6af7 Warn about side-effect free statements. 2017-04-21 11:36:38 +02:00
Alex Beregszaszi
6ae7a87b78 Rename ast to legacyAST in StandardCompiler 2017-04-20 19:38:00 +01:00
Alex Beregszaszi
f71b465eb7 Ensure the language field is present in the JSON 2017-04-20 19:38:00 +01:00
Alex Beregszaszi
6d13260232 Pull out collectEVMObject 2017-04-20 19:38:00 +01:00
Alex Beregszaszi
413c146edd Enclose local functions in a namespace 2017-04-20 19:38:00 +01:00
Alex Beregszaszi
aa0776d5e8 Support Why3 in StandardCompiler 2017-04-20 19:38:00 +01:00
Alex Beregszaszi
b513db74a0 Support gas estimates in StandardCompiler 2017-04-20 19:38:00 +01:00
Alex Beregszaszi
77d5148f0d Reject import URLs for now 2017-04-20 19:38:00 +01:00
Alex Beregszaszi
df7e703925 Support the metadata.useLiteralContent setting 2017-04-20 19:38:00 +01:00
Alex Beregszaszi
ef559de84f Properly split contract filename and name 2017-04-20 19:38:00 +01:00
Alex Beregszaszi
ad1fe86508 Support linkReferences 2017-04-20 19:38:00 +01:00
Alex Beregszaszi
2df52edfbd Support new assembly output 2017-04-20 19:38:00 +01:00
Alex Beregszaszi
a87dd17d0f Move opcodes inside the bytecode section 2017-04-20 19:38:00 +01:00
Alex Beregszaszi
63b6d0099f Support methodIdentifiers 2017-04-20 19:38:00 +01:00
Alex Beregszaszi
f25efceaf8 Support proper error reporting in StandardCompiler 2017-04-20 19:38:00 +01:00
Alex Beregszaszi
b3c6b1e936 Refactor formatError 2017-04-20 19:38:00 +01:00
Alex Beregszaszi
2c15e2b541 Fail if no sources are given 2017-04-20 19:38:00 +01:00
Alex Beregszaszi
5aec120da3 Support the AST output 2017-04-20 19:38:00 +01:00
Alex Beregszaszi
50bb24af5e Include source mapping identifier 2017-04-20 19:38:00 +01:00
Alex Beregszaszi
115458c50e Output legacyAssembly in StandardCompiler 2017-04-20 19:38:00 +01:00
Alex Beregszaszi
4eaee772b3 Capture error messages from the JSON parser 2017-04-20 19:38:00 +01:00
Alex Beregszaszi
f8cb0766d4 Add formatFatalError() to StandardCompiler 2017-04-20 19:38:00 +01:00
Alex Beregszaszi
ce87984cc1 Parse remappings in StandardCompiler 2017-04-20 19:38:00 +01:00
Alex Beregszaszi
81775b2df6 Parse libraries in StandardCompiler 2017-04-20 19:38:00 +01:00
Alex Beregszaszi
13fa440d37 Parse optimizer settings in StandardCompiler 2017-04-20 19:38:00 +01:00
Alex Beregszaszi
418759ece0 Catch exceptions of StandardCompiler 2017-04-20 19:38:00 +01:00
Alex Beregszaszi
985db17e1e Initial implementation of StandardCompiler 2017-04-20 19:38:00 +01:00
Alex Beregszaszi
5754b13b47 Add StandardCompiler skeleton 2017-04-20 19:38:00 +01:00
Alex Beregszaszi
bf074f3f41 Fix source index allocation in CompilerStack. Depending on compiler(optimisations) this could be off-by-one. 2017-04-20 19:20:14 +01:00
Yoichi Hirai
3cacea74c9 Merge pull request #2117 from ethereum/implementAsmOut
Implement missing assembly output functions and do not use PushString for assembly.
2017-04-18 18:11:25 +02:00
Alex Beregszaszi
54dcb0e11b Keep gas values as a string in CompilerStack::gasEstimate 2017-04-13 02:18:29 +01:00
Alex Beregszaszi
3fbb48bd46 Exclude fallback function from the internal functions in estimateGas 2017-04-13 02:17:40 +01:00
Alex Beregszaszi
e6221108b6 Move gasEstimate into CompilerStack 2017-04-13 02:17:37 +01:00
chriseth
4d715e9055 Implement missing assembly output functions and do not use PushString for assembly. 2017-04-11 19:54:44 +02:00
Alex Beregszaszi
bd48f181b5 Merge pull request #2098 from ethereum/sourceformatter
Introduce formatExceptionInformation
2017-04-10 14:46:59 +01:00
Alex Beregszaszi
b1db6eac8b Introduce formatExceptionInformation 2017-04-10 14:07:36 +01:00
Alex Beregszaszi
623b8eb107 Pull out ReadFile from CompilerStack 2017-04-10 12:49:47 +01:00
Federico Bond
e6f13353f2 Fix PostTypeChecker retaining state across contracts 2017-04-08 18:45:15 -03:00
chriseth
4792806b99 Fix: Contract inheriting from base with unimplemented constructor is abstract. 2017-03-21 18:12:08 +01:00
chriseth
5ced3af3a0 Visit structs only once. 2017-03-21 15:05:59 +01:00
Alex Beregszaszi
96c09fcbcd Simplify interface checks for FunctionDefinition 2017-03-17 17:07:20 +00:00
Alex Beregszaszi
2067a00f22 Disallow private or internal functions in interfaces 2017-03-17 17:07:18 +00:00
Alex Beregszaszi
d5102c1db7 Disallow constructor in interfaces 2017-03-17 17:06:52 +00:00
Alex Beregszaszi
2c4bce2d62 Disallow enums in interfaces 2017-03-17 17:06:52 +00:00
Alex Beregszaszi
16a91ef90a Use declared instead of defined 2017-03-17 17:06:52 +00:00
Alex Beregszaszi
f8da9a8fd5 Factor out tokenToContractKind 2017-03-17 17:06:52 +00:00
Alex Beregszaszi
4693aed177 Reject invalid definitions for interface contracts 2017-03-17 16:27:04 +00:00
Alex Beregszaszi
54230d2d5d Support interface (contract) keyword in the parser 2017-03-17 16:27:04 +00:00
Alex Beregszaszi
6d4628ace4 Add ContractKind to ContractDefinition 2017-03-17 16:27:04 +00:00
chriseth
c37397c178 Merge pull request #1773 from ethereum/ASTEntry
Ast entry
2017-03-17 17:24:58 +01:00
chriseth
44a0329921 Comment. 2017-03-17 14:44:44 +01:00
chriseth
245c8914cf Merge pull request #1792 from ethereum/function-kind
Rename FunctionType::Location to Kind
2017-03-17 10:25:58 +01:00
Alex Beregszaszi
e0ff70778a Rename ErrorMesage to ErrorMessage 2017-03-16 23:59:36 +00:00
djudjuu
616a9854e9 AST entry for VariableDeclaration 2017-03-16 16:56:44 +01:00
Alex Beregszaszi
3ae88377d6 Change references to FunctionType::Location 2017-03-16 12:49:52 +00:00
Alex Beregszaszi
7123f25210 Rename FunctionType::Location to FunctionType::Kind 2017-03-16 12:49:17 +00:00
chriseth
0c8a766146 Merge pull request #1698 from ethereum/exp-notation
Fix scientific notation in number literals
2017-03-15 14:55:45 +01:00
Alex Beregszaszi
e923f27ea8 Split out parseRational from isValidLiteral 2017-03-15 13:06:27 +00:00
Alex Beregszaszi
dde87de4cf Rename x to value 2017-03-15 13:06:27 +00:00
Alex Beregszaszi
a2b9f52ca4 Disallow radix points in hex literals 2017-03-15 13:06:27 +00:00
Alex Beregszaszi
07045d492f Do not try parsing hex numbers as scientific notation 2017-03-15 13:06:27 +00:00
Alex Beregszaszi
dfc8f890bf Support older version of boost 2017-03-15 13:06:27 +00:00
Alex Beregszaszi
1083e6da68 Support negative exponent 2017-03-15 13:06:26 +00:00
Alex Beregszaszi
924a8fff6b Fix exponentional notation in number literals 2017-03-15 13:06:24 +00:00
chriseth
ab178b8bac Mention 'transfer' in warning about unchecked 'send'. 2017-03-15 11:10:24 +01:00
Yoichi Hirai
d134fda0c0 Merge pull request #1729 from ethereum/constantvariables
Only allow pure expressions for constant state variables.
2017-03-15 10:03:35 +01:00
chriseth
9f328ff749 Turn non-constant constants error into warning. 2017-03-14 19:25:16 +01:00
chriseth
47cd8964b8 Require and Assert. 2017-03-14 14:21:33 +01:00
chriseth
592cec7e90 Disallow constants that are neither value types nor strings. 2017-03-13 13:30:23 +01:00
chriseth
14948e514d Allow enum values for constants. 2017-03-13 13:30:23 +01:00
chriseth
f39763e91c Type checking for pure expressions. 2017-03-13 13:30:21 +01:00
Yoichi Hirai
ef8b56a058 Merge pull request #1751 from ethereum/warnLiteralExpBase
Warn if base of exponentiation operation is a literal.
2017-03-10 19:25:47 +01:00
Ryan Casey
fe8d09a3c1 Fix 'ambiguous overload for operator==' Boost error. 2017-03-09 17:04:26 -08:00
Ryan Casey
797e05ba08 Resolve build-stopping error about 'minor' and 'major' being defined in <sys/types.h> 2017-03-09 17:03:19 -08:00
Yoichi Hirai
e364909e06 Merge pull request #1747 from ethereum/fixICEInternalConstructor
Move privateness of constructor into AST itself.
2017-03-08 17:49:14 +01:00
chriseth
3f9a775834 Merge pull request #1748 from ethereum/singletonArray
Use mobile type for singleton array.
2017-03-08 16:11:03 +01:00
chriseth
93ef7fd260 Disallow compound assignment for tuples. 2017-03-08 12:42:07 +01:00
Yoichi Hirai
78f7dd2344 Merge pull request #1750 from ethereum/asmoctal
Disallow octal numbers in parser.
2017-03-08 12:24:22 +01:00
Yoichi Hirai
a1e350a4ae Merge pull request #1699 from ethereum/asmlabels
Assembly labels with stack information
2017-03-08 11:56:44 +01:00
chriseth
1324ebc4bf Warn about literal constant base in exponentiation. 2017-03-07 13:44:11 +01:00
chriseth
bb06569dc6 Disallow octal literals. 2017-03-07 12:34:32 +01:00
chriseth
a2ac05e1a2 Merge pull request #1733 from ethereum/selfReferentialConstant
Detect cyclic dependencies between constants.
2017-03-06 17:18:39 +01:00
chriseth
2fcccb97d3 Merge pull request #1737 from ethereum/localmappings
Disallow uninitialized mapping variables.
2017-03-06 15:05:58 +01:00
chriseth
5c5d83fd70 Check for circular references in constant variables. 2017-03-06 15:05:09 +01:00
chriseth
c500d9f717 Convert to mobile type for array type. 2017-03-06 14:42:28 +01:00
chriseth
c126edc6ea Disallow uninitialized mapping variables. 2017-03-06 14:27:18 +01:00
chriseth
960b5fa032 Error constructor. 2017-03-06 14:27:18 +01:00
chriseth
f300bdb020 Move public constructor property into AST itself. 2017-03-06 14:12:42 +01:00
chriseth
ca4e2933dd Strict checking for AST annotation types. 2017-03-06 14:12:42 +01:00
chriseth
f521fd7b19 Mention way to remove warning. 2017-03-06 13:37:57 +01:00
Yoichi Hirai
cfbbd89daf Merge pull request #1702 from ethereum/assertError
Change effect of assert to invalid opcode.
2017-03-03 18:25:50 +01:00
chriseth
f8ce32f2a6 Fix error message. 2017-03-03 15:41:02 +01:00
chriseth
369005fc03 Remove stack annotations again. 2017-03-03 15:41:02 +01:00
chriseth
13fd569f76 First reset stack height, then register variables. 2017-03-03 15:41:02 +01:00
chriseth
455e8a4ef8 Move lambda. 2017-03-03 15:41:02 +01:00
chriseth
41236cd08c Slightly cleaner label ids. 2017-03-03 15:41:02 +01:00
chriseth
e963405a19 Partially add functions. 2017-03-03 15:41:02 +01:00
chriseth
647473cf01 Generic visitor. 2017-03-03 15:41:02 +01:00
chriseth
caa3761dc9 Refactor variable access. 2017-03-03 15:41:02 +01:00
chriseth
25dcfa3480 Refactor CodeGen to recurse on blocks. 2017-03-03 15:41:01 +01:00
chriseth
7f2def8971 Analysis refactoring. 2017-03-03 15:41:01 +01:00
chriseth
98e343b3fc Parsing of labels with stack info. 2017-03-03 15:41:01 +01:00
chriseth
cc01d870ff Disallow variable declaration with inferred empty tuple type. 2017-03-02 14:33:58 +01:00
chriseth
5c411b472b Merge pull request #1728 from ethereum/externalfunctiontypes
Convert reference types to pointers in member function conversion.
2017-03-02 12:08:17 +01:00
chriseth
a689152c4b Convert reference types to pointers in member function conversion. 2017-03-01 16:02:36 +01:00
chriseth
7a24a5764e Add line info to serious exceptions. 2017-02-24 19:32:41 +01:00
chriseth
d2c79bf8e9 Merge pull request #1700 from ethereum/fixNoMobile
Some checks for the existence of mobile type.
2017-02-24 15:50:45 +01:00
chriseth
92bf5154fd Merge branch 'develop' into fixNoMobile 2017-02-24 10:39:55 +01:00
Alex Beregszaszi
4d290e551c Disallow setting .gas() on .transfer() 2017-02-24 00:27:36 +00:00
Alex Beregszaszi
c674155e58 Do not keep the gas stipend if sending non-zero value 2017-02-24 00:18:18 +00:00
Alex Beregszaszi
81006dae98 Support gas modifier on addr.transfer() 2017-02-24 00:18:18 +00:00
Alex Beregszaszi
4264625c69 Implement address.transfer() 2017-02-24 00:17:45 +00:00
chriseth
4b1e8111cc Remove assert for now. 2017-02-23 19:43:40 +01:00
chriseth
c0961664f9 Deposit one stack item for non-value types in inline assembly type checking. 2017-02-20 12:33:22 +01:00
chriseth
7bdc4ddab2 Merge pull request #1627 from ethereum/asmfunctions
Parsing assembly function definitions and calls.
2017-02-16 20:12:31 +01:00
chriseth
811bb770c5 Change effect of assert to invalid opcode. 2017-02-16 15:54:17 +01:00
chriseth
c3c3cccbec Fix early exist for fatal errors. 2017-02-16 14:57:00 +01:00
chriseth
dcc16c81e2 Some checks for the existence of mobile type. 2017-02-16 11:46:27 +01:00
chriseth
a5ce81100e Assembly printer for functions. 2017-02-16 10:18:12 +01:00
chriseth
49a919b3e0 Parsing function calls. 2017-02-16 10:15:22 +01:00
chriseth
5d584aded8 Parsing function definitions. 2017-02-16 10:15:22 +01:00
chriseth
24197a2b3f Assembly printing fixes. 2017-02-14 15:41:25 +01:00
chriseth
ca71b7624d Review changes. 2017-02-14 15:41:25 +01:00
chriseth
80f7243786 Assembly printer. 2017-02-14 15:41:25 +01:00
chriseth
a791ec75e2 Review comments. 2017-02-14 13:32:48 +01:00
chriseth
b1bb228ab3 Allow different entry scope for registerDeclarations. 2017-02-14 13:23:44 +01:00
chriseth
e67faa9839 Extract scopes into compiler stack. 2017-02-14 13:23:44 +01:00
chriseth
c87bafd2ed Refactor type system to allow multiple entry points. 2017-02-14 13:23:44 +01:00
chriseth
fc8e50f688 Refactor NameAndTypeResolver and SyntaxChecker to allow other entry points. 2017-02-14 13:23:44 +01:00
Alex Beregszaszi
c8ec79548b Use the revert opcode in assert() 2017-02-10 22:53:32 +00:00
Alex Beregszaszi
586d156f33 Use the REVERT opcode for throw; 2017-02-10 22:41:09 +00:00
Alex Beregszaszi
f3158f92d6 Support revert() 2017-02-10 22:40:42 +00:00
Alex Beregszaszi
8a3d4a0500 Cleanup is not needed for assert() 2017-02-10 13:32:36 +00:00
Alex Beregszaszi
f8461e9e31 Implement assert as a global function 2017-02-10 13:29:17 +00:00
Alex Beregszaszi
693226b1ab Rename SUICIDE opcode to SELFDESTRUCT in libevmasm 2017-02-06 20:17:52 +00:00
Alex Beregszaszi
ba0015cf25 Warn early when exhausting stack 2017-02-02 11:39:29 +00:00
Alex Beregszaszi
697db80b48 Disallow arrays with negative length 2017-02-02 00:24:45 +00:00
Alex Beregszaszi
c01f5699e6 Add isNegative to RationalNumberType 2017-02-02 00:16:50 +00:00
Alex Beregszaszi
4361797ddc Only capture function type to address conversion 2017-02-01 12:23:47 +00:00
Alex Beregszaszi
ce62c7c01c Be more verbose on the stack-mismatch errors 2017-02-01 12:23:47 +00:00
Alex Beregszaszi
767ec1d670 Support explicit conversion of external function type to address 2017-02-01 12:23:47 +00:00
chriseth
b2c35fb41a Merge pull request #1598 from wuestholz/develop
Change translation of implicit throws
2017-01-27 14:10:22 +01:00
chriseth
636e480156 Merge pull request #1451 from LefterisJP/fix_build
Accept any kind of whitespace after natspec tags
2017-01-27 14:09:39 +01:00
chriseth
0e021e76a5 Minor changes. 2017-01-27 11:19:48 +01:00
chriseth
bff8fc23e6 Changelog and review suggestions. 2017-01-27 10:18:53 +01:00
Lefteris Karapetsas
98b51b378e
More verbose function naming 2017-01-27 00:09:00 +01:00
Lefteris Karapetsas
cc7834f2a9
Doc tags followed by newline are now parsed properly 2017-01-27 00:00:05 +01:00
chriseth
a9c6ff4ac8 Refactor json return type generation. 2017-01-26 18:21:19 +01:00
chriseth
a98fa41897 Uninitialized internal function should call INVALID. 2017-01-26 16:39:07 +01:00
chriseth
d9fbb83861 Allow inserting low-level functions without calling them. 2017-01-26 16:39:07 +01:00
chriseth
390bebaaf9 Split line. 2017-01-26 16:39:07 +01:00
Valentin Wüstholz
5b7cc018f0 Address feedback from code review. 2017-01-26 16:39:07 +01:00
Valentin Wüstholz
9bcbd93ac5 Change translation of implicit throws (issue #1589).
This adds a new invalid instruction that is used for encoding
implicit throws that are emitted by the compiler. This makes it
possible to distinguish such runtime errors from user-provided,
explicit throws.
2017-01-26 16:39:07 +01:00
Alex Beregszaszi
102fd7ee5d Merge pull request #1604 from ethereum/checksums
Warn about invalid checksums of addresses.
2017-01-26 14:42:34 +00:00
Alex Beregszaszi
fcf483ee6b Add option to store literal sources in metadata 2017-01-26 13:16:26 +00:00
chriseth
873f2dddd6 Update error message. 2017-01-26 13:52:02 +01:00
chriseth
525758a130 Disallow assignment to non-identifiers. 2017-01-26 13:40:40 +01:00
chriseth
f62e269115 Disallow instructions in assignment. 2017-01-25 17:29:06 +01:00
chriseth
a5696e1f0a Renamed function. 2017-01-25 17:26:11 +01:00
chriseth
27ba665694 Moved test. 2017-01-25 17:24:43 +01:00
Alex Beregszaszi
900c56d996 Do not allow shadowing inline assembly instructions with variables 2017-01-25 11:28:09 +00:00
Lefteris Karapetsas
9ca0fde853 Fix and better output for tests 2017-01-25 11:01:52 +01:00
Lefteris Karapetsas
5738e865d5 Accept any kind of whitespace after natspec tags 2017-01-25 11:01:52 +01:00
chriseth
3949624a61 Also check library addresses. 2017-01-24 23:37:48 +01:00
chriseth
1316bb7565 Warn about invalid checksums of addresses. 2017-01-24 23:37:48 +01:00
chriseth
ead1a3b33f Include creation code only once. 2017-01-24 17:41:31 +01:00
chriseth
7e6f1b3f00 Use int arithmetics for stack adjustment. 2017-01-24 12:07:09 +01:00
chriseth
23eca813f5 Change clearStorageLoop to TypePointer. 2017-01-24 12:07:09 +01:00
chriseth
82a00e7dc5 Use shared_ptrs to enable shared_from_this. 2017-01-24 12:06:41 +01:00
chriseth
cea020b89e Convert ArrayUtils routines into low-level functions. 2017-01-24 12:06:40 +01:00
chriseth
b60623521f Move some util functions to low-level functions. 2017-01-24 12:06:40 +01:00
chriseth
d0e8d340a5 Low level named functions for CompilerContext. 2017-01-24 12:06:40 +01:00
chriseth
b52a60402d Merge pull request #1245 from ethereum/1215
Allow multiple events of the same name
2017-01-24 11:52:21 +01:00
Yoichi Hirai
4e1fd68b38
analysis: disallow overloading functions with events 2017-01-23 15:25:13 +01:00
Yoichi Hirai
399b7b695a
analysis: fix format 2017-01-23 15:25:13 +01:00
Yoichi Hirai
846f7dc3ea
analysis: Resolve event overloading 2017-01-23 15:25:13 +01:00
Yoichi Hirai
08015590f2
analysis: Allow multiple events of the same name
Fixes #1215
2017-01-23 15:25:13 +01:00
Yoichi Hirai
9c278448c8 Merge pull request #1591 from ethereum/stackTooDeepLocation
Report source location on "stack too deep" errors.
2017-01-23 15:02:22 +01:00
chriseth
0ef460461a Check if constructor is public or not. 2017-01-20 19:22:39 +01:00
chriseth
2536bdd6d0 Report source location on "stack too deep" errors. 2017-01-20 19:01:19 +01:00
Yoichi Hirai
12b002b3b8 Merge pull request #1576 from ethereum/typeIdentifiers
Type identifiers.
2017-01-20 16:18:57 +01:00
chriseth
07b0a0a560 Make m_id const. 2017-01-20 15:56:56 +01:00
chriseth
7159944f0f Reset AST node IDs between compilation runs. 2017-01-20 12:00:16 +01:00
chriseth
da178d967f Properly escape user strings and lists. 2017-01-19 13:23:58 +01:00
chriseth
3fed790a56 Type identifiers. 2017-01-19 13:23:57 +01:00
chriseth
23a654ade8 Fix default function type name visibility. 2017-01-19 11:11:40 +01:00
Federico Bond
d40ae663ec Fix typo in comment 2017-01-18 12:43:23 -03:00
chriseth
28a05e5aa3 Merge pull request #1581 from ethereum/fixosx
Fix JSON output on macos.
2017-01-18 15:41:39 +01:00