Commit Graph

184 Commits

Author SHA1 Message Date
Alex Beregszaszi
a9819aa8bc Remove code generation for Throw statement
It is disallowed in the type system.
2018-08-08 17:02:25 +01:00
Alex Beregszaszi
9062704054
Merge pull request #4753 from mattaereal/boost-to-string-patch
Replace boost:lexical_cast<std::string> for std::to_string.
2018-08-08 16:07:25 +01:00
Matías Aereal Aeón
e902ce1aa0 Removing std:: from std::to_string and include for boost/lexical_cast 2018-08-08 11:26:30 -03:00
chriseth
71e26f6adb Remove clone feature. 2018-08-07 11:10:50 +01:00
Alex Beregszaszi
f74cff622d Properly explain all the analsys steps in CompilerStack 2018-07-31 00:39:18 +01:00
Daniel Kirchner
fc370591f0 Disallow multi variable declarations with mismatching number of values. 2018-07-12 20:33:51 +02:00
Leonardo Alt
0c5e0e0d59 Added assertion and tests suggestions 2018-07-10 18:39:38 +02:00
Leonardo Alt
b750ca9741 Add more tests and assertions 2018-07-10 18:39:38 +02:00
Leonardo Alt
9d895e002d Added tests and review suggestions 2018-07-10 18:39:38 +02:00
Leonardo Alt
1f77deada1 [050] Reserving and popping local vars in their scope 2018-07-10 18:39:38 +02:00
Alex Beregszaszi
1d57d74e82 Fail if break/continue statements are used outside for/while loops in ContractCompiler 2018-06-12 00:46:23 +01:00
Daniel Kirchner
f627dc77d0 Fix continue inside do-while. 2018-05-16 18:32:48 +02:00
chriseth
7a9ee69e98 Bubble up error messages. 2018-04-12 13:09:38 +02:00
Daniel Kirchner
3eedbc6a9c Error when using no parentheses in modifier-style constructor calls. 2018-04-10 12:09:34 +02:00
Daniel Kirchner
b918a105a4 Move constructor argument override check to TypeChecker and reuse annotations in ContractCompiler. 2018-04-09 15:26:08 +02:00
Daniel Kirchner
96eff0ff6a Error when using empty parenthesis for base class constructors that require arguments. 2018-04-05 11:52:22 +02:00
chriseth
a54fdc495f Fix: Treat empty base constructor argument list as not provided. 2018-04-03 14:53:48 +02:00
chriseth
32c94f5059 Simple size check for old ABI decoder. 2018-03-21 14:53:25 +00:00
chriseth
2cdf44f65c Move the old ABI decoder code. 2018-03-20 15:20:43 +00:00
chriseth
069b150e42 Bugfix in virtual lookup for modifiers in libraries. 2018-03-13 16:55:41 +01:00
chriseth
6ec4517929 Use EVM version in gas meter and optimizer. 2018-03-05 11:36:33 +01:00
chriseth
388718b59f Introduce emit statement. 2018-02-22 15:17:30 +01:00
chriseth
6807010dc7 Prevent libraries from being called. 2018-01-19 16:27:44 +01:00
chriseth
5a3dbb0269 Cleanup and overflow checks for data pointers. 2017-11-29 17:08:44 +01:00
chriseth
bdc1ff8ec7 ABI decoder. 2017-11-29 17:08:44 +01:00
chriseth
a3db1fc197 Do not accept truncated function selectors. 2017-10-17 23:17:36 +02:00
Alex Beregszaszi
204214f070 Split encodeToMemory to packedEncode and abiEncode 2017-09-27 11:32:19 +01:00
chriseth
22f85d5af3 Update tests and error messages. 2017-09-16 12:12:43 +01:00
chriseth
80ce3ca66f Move ABI encoder into its own function. 2017-09-15 20:46:32 +01:00
Alex Beregszaszi
7fb4a64136 Move all file specific globals to anonymous namespace 2017-08-29 11:09:18 +01:00
Alex Beregszaszi
2a5772cff7 Mark appropriate constructors explicit 2017-08-22 10:51:46 +01:00
chriseth
d1ad62fccc Experimental feature switch for ABI encoder. 2017-08-14 13:11:41 +01:00
Alex Beregszaszi
7d37eba4ba Remove the need of jumping out of the fallback 2017-07-27 21:52:58 +01:00
chriseth
d58e439094 Fix internal "variable already present" error. 2017-07-04 19:33:55 +02:00
chriseth
71d866cd7a Abort early if there is nothing to encode or decode. 2017-06-30 14:16:16 +02:00
Alex Beregszaszi
6a708b0cfe Document appendFunctionSelector 2017-06-28 18:00:40 +02:00
chriseth
ef9a7b2144 Stack adjustment and code generation for fallback function.
This assumes that the fallback function does not have return parameters.
2017-06-28 18:00:31 +02:00
chriseth
168f64f4cb Fix negative stack size checks. 2017-06-28 16:55:49 +01:00
Alex Beregszaszi
a0b0df2d98 Merge pull request #2460 from ethereum/disallowMultiModifier
Disallow invoking the same modifier multiple times.
2017-06-26 11:51:12 +01:00
chriseth
5a75581f66 Disallow invoking the same modifier multiple times. 2017-06-23 20:12:22 +02:00
chriseth
831ed08387 Change invalid opcode to revert for input validation. 2017-06-23 19:29:11 +02:00
chriseth
ef3d5874fe Remove error reporter from code generation phase. 2017-06-08 15:52:45 +02:00
chriseth
97cc968a13 Initial EVM1.5 assembly implementation. 2017-06-08 15:52:44 +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
chriseth
261731f7ee Adapt EVM codegen to new namespace. 2017-05-26 15:08:27 +02:00
chriseth
e2b21e1c96 Refactor to abstract assembly to JULIA. 2017-05-19 19:20:28 +02:00
chriseth
f3ec2ba39e Refactor to combined scope and stack height info. 2017-04-26 17:12:04 +02:00
chriseth
e841b23bfd Special case for storage types with offset zero. 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
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
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
e0849f2f3b Split external identifier access into resolving and code generation. 2017-04-25 16:49:03 +02:00
Alex Beregszaszi
586d156f33 Use the REVERT opcode for throw; 2017-02-10 22:41:09 +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
bff8fc23e6 Changelog and review suggestions. 2017-01-27 10:18:53 +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
chriseth
b60623521f Move some util functions to low-level functions. 2017-01-24 12:06:40 +01:00
chriseth
2536bdd6d0 Report source location on "stack too deep" errors. 2017-01-20 19:01:19 +01:00
Rhett Aultman
1f30982ab5 Use fully-qualified names for linking, too
Using libraries leaves behind a library link reference in the binary
which the linker must later resolve.  These link references were still
being generated by name and not by fully-qualified name.  This would
lead to a link-time collision between two libraries having the same
name but in different source units.

This change changes linker symbols over to fully-qualified names,
which resolves that issue.  This does potentially introduce a new
problem, which is that linker symbols appear to be limited to 36
characters and are truncated.  Storing paths extends the average
symbol size, and it would be great if truncation was from the tail
rather than the head.
2017-01-16 12:32:57 -05:00
chriseth
55a719a79c Merge pull request #1462 from ethereum/fix-incorrect-assertion
codegen: assertion did not assert non-nullness
2016-12-01 15:14:31 +01:00
Yoichi Hirai
1e791f30aa
codegen: this commit removes one of duplicate assignments 2016-12-01 12:03:25 +01:00
Yoichi Hirai
e29047b24d
codegen: assertion did not assert non-nullness
This commit strengthens an assertion so that it makes sure that a pointer is not null.
Moreover, `isLocalVariable(variable)` is now positively asserted, following the error message.
2016-12-01 11:58:34 +01:00
VoR0220
3f9f725737 Fix licensing headers
Signed-off-by: VoR0220 <rj@erisindustries.com>
2016-11-23 12:22:33 +01:00
Alex Beregszaszi
910269a29f Add appendCallValueCheck 2016-11-17 17:23:35 +00:00
Alex Beregszaszi
ceeb8f4a2b Add payable check for constructor in codegen 2016-11-17 17:23:35 +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
dd173f83e3 Code generator for function types. 2016-11-16 14:37:17 +01:00
Rhett Aultman
58e75c7a48 Unimplemented features moved to their own exception (#1361)
Unimplemented features moved to their own exception

InternalCompilerError is an exception that really should be reserved for
actual internal errors of the compiler.  Unimplemented features can now
use either solUnimplemented( ) or, if it should be conditional, then
solUnimplementedAssert( ).

* Revert some unimplemented exceptions, add handlers

The jsonCompiler and CommandLineInterface needed handlers for the
new UnimplementedFeatureException, and some cases I had moved on to
the new exception were better treated as real internal compiler
errors.

* Standardize on "Unimplemented feature" message
2016-11-14 20:41:58 +00:00
Rhett Aultman
4524ad0870 Add support for do/while loops
This commit adds support for a standard do <statement> while <expr>;
form of statement.  While loops were already being supported; supporting
a do/while loop mostly involves reusing code from while loops but putting
the conditional checking last.
2016-11-10 07:07:25 -08:00
Alex Beregszaszi
0e33b63468 Allow warnings for inline assembly block 2016-10-20 13:25:28 +01:00
chriseth
727c6fac85 Allow value transfer to library functions. 2016-09-17 11:29:27 +02:00
chriseth
9c64edf110 Change function type to include and propagate payable and constant modifier. 2016-09-05 21:28:28 +02:00
Alex Beregszaszi
962531af96 Merged in changes from chriseth/payable 2016-09-05 21:28:28 +02:00
Alex Beregszaszi
a34f2f1a31 Support payable keyword for functions 2016-09-05 21:28:18 +02:00
chriseth
4bfe09897e Make fallback function throw by default. 2016-08-30 15:31:50 +02:00
chriseth
9c83109549 BREAKING: return only exits current function/modifier 2016-08-17 11:29:31 +02:00
chriseth
ab7a22f4a0 Disallow implementation of abstract function by constructor of derived class. 2016-06-06 19:38:22 +02:00
chriseth
6b859a2bff Refactor compiler to avoid weird swap of contexts 2016-05-20 14:20:45 +02:00