chriseth
02373c2225
Adjust uses of AsmCodeGen.
2019-02-13 11:35:49 +01:00
chriseth
1ff6f2c71c
Move AsmCodeGen.
2019-02-13 11:20:15 +01:00
Daniel Kirchner
0e4912a203
ABIEncoderV2: Implement calldata structs without dynamically encoded members.
2019-02-11 15:46:58 +01:00
chriseth
a8d0ef4bad
Allow indexed structs in events with encoder v2.
2019-02-11 11:37:47 +01:00
chriseth
a08f4f43fa
Add packed encoder V2.
2019-02-11 11:37:47 +01:00
chriseth
1b9d30f05f
Packed encoding.
2019-02-11 11:37:47 +01:00
chriseth
fc18258250
Remove type check that is covered by assertions.
2019-02-07 12:02:15 +01:00
chriseth
49f8fa4cfe
Extract storing length to its own function.
2019-02-06 14:03:49 +01:00
chriseth
77baf6caf7
Compilability checker.
2019-02-04 17:32:05 +01:00
chriseth
cd8cf7745b
Merge pull request #5888 from ethereum/betterStackErrorMessages
...
Better error message for out of stack in assembly.
2019-02-04 15:26:55 +01:00
chriseth
17a1e7aed5
Better error message for out of stack in assembly.
2019-01-30 12:24:10 +01:00
chriseth
35483422f3
Pad code to multiple of 32 bytes.
2019-01-30 11:31:28 +01:00
chriseth
64312584dc
Do not provide access to external assembly variables from within functions.
2019-01-28 14:42:38 +01:00
chriseth
628d665474
Merge pull request #5843 from ethereum/abi-typos
...
Do not ignore revertOnFailure flag when validating Address/Contract
2019-01-22 18:44:09 +01:00
Alex Beregszaszi
3f2898ea47
Do not ignore revertOnFailure flag when validating Address/Contract
2019-01-22 14:45:08 +00:00
chriseth
01e87cfc08
Refactor struct encoder.
2019-01-22 14:45:25 +01:00
chriseth
7a69455c13
Provide ABI encoding options as single struct parameter.
2019-01-21 16:43:32 +01:00
chriseth
29f6aa7d56
Do not create a copy of the assembly.
2019-01-17 20:36:48 +01:00
chriseth
e6fee257e6
Code generation for access to contract code.
2019-01-17 20:36:48 +01:00
chriseth
2fcfb216b5
Syntax for meta type information.
2019-01-17 20:36:48 +01:00
Christian Parpart
62fe57479e
make use of C++ = default
constructor declarations as well as more non-static member initialization syntax.
2018-12-19 11:26:42 +01:00
chriseth
d8218b7eef
Formatting.
2018-12-18 23:50:39 +01:00
Mathias Baumann
1b8570f829
Only generate sort/search code when interface functions exist
2018-12-17 21:24:37 +01:00
Leonardo Alt
ab76676271
Sort includes in libsolidity/codegen
2018-12-17 17:06:11 +01:00
Alex Beregszaszi
c863cbf80d
Add missing header guards
2018-12-12 15:47:05 +00:00
chriseth
fb3a0ac1c7
Codegen for object access.
2018-12-11 19:24:44 +01:00
chriseth
8d49e53995
Provide Dialect to EVMCodeTransform.
2018-12-11 19:24:31 +01:00
chriseth
b5deca0383
Merge pull request #4779 from ethereum/optimise-string-literals
...
Decide better in storing string literals as data
2018-12-11 17:50:14 +01:00
Mathias Baumann
2f6dc2e773
Replace push_back with emplace_back where it makes sense
2018-12-10 19:02:39 +01:00
chriseth
53f531ecb0
Set codecopy limit for data to 32 bytes.
2018-12-10 17:11:48 +01:00
liangdzou
362648a450
Reuse stack slots in Yul to EVM code generation.
2018-12-10 14:28:56 +01:00
chriseth
6a9e8a6fe3
Merge pull request #4936 from ethereum/binSelect
...
Binary search for dispatch.
2018-12-07 00:55:09 +01:00
chriseth
f6ed29b88b
Extend abstract assembly to be able to handle sub-objects.
2018-12-06 14:32:04 +01:00
chriseth
4721cf332f
Expose EthAssemblyAdapter.
2018-12-06 14:32:04 +01:00
Christian Parpart
073b03d90c
liblangutil: refactor SourceReferenceFormatter, splitting out retrieval and making use of new SourceLocation's CharStream knowledge
2018-12-06 14:01:01 +01:00
chriseth
7f39c3e522
Binary search for dispatch.
2018-12-06 13:07:14 +01:00
chriseth
7ee1ddc172
Switch namespaces.
2018-12-04 15:36:03 +01:00
chriseth
0b1125281a
Remove some includes.
2018-12-04 15:31:00 +01:00
chriseth
3ebb78a886
Adjust include paths.
2018-12-04 15:20:29 +01:00
chriseth
0ec7a0e72c
Move AsmCodeGen.
2018-12-04 15:20:23 +01:00
chriseth
99db4e3ff4
Introduce the concept of builtin functions.
2018-12-04 12:06:33 +01:00
chriseth
aaeb74f592
Merge pull request #5537 from ethereum/cp-SourceLocation-related-refactoring
...
[1/3] SourceLocation related refactoring.
2018-11-30 23:45:31 +01:00
Christian Parpart
435f7b3b72
liblangutil: Scanner: remove superfluous sourceName field (it's in CharStream already)
...
Also, ParserBase::sourceName() was dead code. Eliminating it should
increase test coverage (how sneaky) :-)
2018-11-30 17:07:17 +01:00
chriseth
73a64da041
Fix bug related to state variables of function type accessed via base contract.
2018-11-29 19:30:27 +01:00
Christian Parpart
22eff22492
liblangutil: extends CharStream to know about the respective (file-)name (and adapt codebase to it)
2018-11-29 12:45:27 +01:00
hydai
9326adc3db
Replace IntegerType(256) with static function IntegerType::uint256()
2018-11-29 17:07:18 +08:00
Daniel Kirchner
30e6f8d3fb
Allow mapping arguments for public and external library functions.
2018-11-26 16:31:46 +01:00
chriseth
764d618c44
Merge pull request #5404 from ethereum/jumpFixes
...
Annotate jump from calldata decode to function as "jump in".
2018-11-26 16:08:04 +01:00
chriseth
0b474d5299
Merge pull request #5497 from ethereum/langutil-SourceReferenceFormatter
...
Moving SourceReferenceFormatter into langutil namespace.
2018-11-26 12:44:25 +01:00
chriseth
bc137c2eeb
Merge pull request #5485 from ethereum/refactorCallableFunction
...
Refactor callable function
2018-11-26 12:34:43 +01:00
chriseth
0e08fb7469
Use "in" tag for jumps from unpacker to function.
2018-11-26 11:02:58 +01:00
Christian Parpart
aeb66905de
Moving SourceReferenceFormatter into langutil namespace.
2018-11-24 12:33:36 +01:00
Christian Parpart
ec47c8946b
Isolating libyul library API into its own namespace yul
.
2018-11-23 14:29:00 +01:00
Christian Parpart
713d94476e
Reorder some include files and group <libyul/>'s together (as much as possible)
2018-11-23 12:37:19 +01:00
Christian Parpart
0f4ed52a71
Rewrite header paths to adapt to recent git mv
of libsolidity/inlineasm to libyul
2018-11-23 11:18:57 +01:00
chriseth
62e801ed70
Use callable function for virtual resolution.
2018-11-22 15:48:12 +01:00
Leonardo Alt
06189ae57f
Add assert and tests for bound functions
2018-11-22 14:41:39 +01:00
Christian Parpart
d67322a186
Introduce namespace langutil
in liblangutil directory.
...
Also:
- Use {}-style list initialisation for SourceLocation construction
- Introduce new system includes
- Changes the API of the Scanner to take source as value (with move) as opposed to as a reference
2018-11-21 19:13:44 +00:00
Christian Parpart
87821c53c3
Isolating files shared between Yul- and Solidity language frontend.
2018-11-21 18:58:12 +00:00
mordax
ea8b7d803e
Removing redundant virtual from override function declaration
...
Remove trailing whitespace
Remove changelog change
2018-11-21 14:37:32 +00:00
chriseth
727e3f24bc
Do not perform cleanup on unsigned integers when loading from calldata.
2018-11-14 20:52:30 +00:00
chriseth
6bbedab383
Merge pull request #5265 from ethereum/cleanupsha3
...
Simplify sha3.
2018-11-09 15:39:57 +01:00
chriseth
84e8a782d6
Merge pull request #5351 from ethereum/functionTypeConversion
...
Relax type equality requirement of function types during conversion in code generation.
2018-11-08 11:29:55 +01:00
Daniel Kirchner
b16a3644fe
Function type conversion test cases.
2018-11-08 10:51:51 +01:00
chriseth
674e17c2a8
Performance: Replace string by special single-copy YulString class.
2018-11-07 19:30:27 +01:00
Daniel Kirchner
a3e37a9d5a
Relax identity requirement of function type conversions during code generation.
2018-11-06 13:22:33 +01:00
chriseth
4d82831b06
Merge pull request #5316 from lazaridiscom/4891-memory-store-asserts
...
refine memory-store assertions, closes #4891
2018-10-28 20:50:41 +01:00
Lazaridis
cab8dea7fe
refine memory-store assertions, closes #4891
2018-10-27 00:04:54 +03:00
Christian Parpart
f112377dd4
Refactor solidity::Token
into an enum class
with TokenTraits
helper namespace
2018-10-22 17:00:51 +02:00
chriseth
c13b5280c1
Merge pull request #5256 from ethereum/lvalueCleanup
...
Lvalue cleanup
2018-10-19 11:20:12 +02:00
chriseth
e78b95d9d4
Renamed SHA3.{h,cpp} files.
2018-10-18 14:31:36 +02:00
chriseth
97d01d9b47
Assert about some removed language concepts in the code generator.
2018-10-17 22:26:40 +02:00
chriseth
c14dfeb8c5
Removed unreachable cases in LValue.cpp.
2018-10-17 22:17:33 +02:00
chriseth
5e01d767d0
Prevent externally used functions from being removed.
2018-10-17 14:12:10 +02:00
Christian Parpart
1304361b9c
Renaming namespace dev::julia to dev::yul.
2018-10-15 11:58:51 +02:00
Alex Beregszaszi
fa0ce6a7e7
Use empty() instead of size() == 0
2018-10-09 04:29:37 +01:00
chriseth
d76bfcd935
Fix typos.
2018-10-04 13:28:16 +02:00
chriseth
db4f780283
Merge pull request #4962 from anurag-git/anurag_issue_3667-1
...
Removed default case from "ExpressionCompiler::visit(FunctionCall...)".
2018-10-01 13:24:26 +02:00
Anurag Dashputre
3321000f67
Removing extra default cases to force compile time error, instead of runtime.
2018-09-30 12:40:38 +05:30
liangdzou
44e8dfd393
fix typo
2018-09-20 22:54:57 +08:00
Jordan Last
d0497aacc0
fixing rebase conflicts
...
add ElementaryTypes::BytesMemory and ElementaryTypes::StringMemory
fix rebase conflicts
fixing rebase conflicts
use make_shared instead of new
fix tabs and StateMutability parameter
create address and addressType functions, fix spaces in comment
fix typo and switch nonpayable to payable
fix spaces
fix comment again
2018-09-13 15:53:06 -06:00
Daniel Kirchner
12aaca1645
Add payable and non-payable state mutability to AddressType.
2018-09-13 15:15:49 +02:00
Anurag Dashputre
b86cea033b
Removed default case from "ExpressionCompiler::visit(FunctionCall...)".
2018-09-13 15:40:06 +05:30
chriseth
120438c0cf
Always perform cleanup for EXP.
2018-09-10 12:47:46 +02:00
Daniel Kirchner
87804b6419
Split IntegerType into IntegerType and AddressType.
2018-09-05 12:19:14 +02:00
chriseth
e6aa15bae1
Merge pull request #4895 from ethereum/abidecodesingle
...
Fix abi.decode returning single value.
2018-09-04 23:47:56 +02:00
chriseth
624dbbe142
Fix abi.decode returning single value.
2018-09-04 18:19:00 +02:00
Daniel Kirchner
1ae6ec9038
Remove trailing whitespace.
2018-09-04 17:43:04 +02:00
Daniel Kirchner
82f512a7d4
Add return data to bare calls.
2018-09-04 13:31:10 +02:00
Daniel Kirchner
a102f3b783
Remove trailing whitespace for all files in the repository.
2018-09-04 11:30:30 +02:00
Anurag Dashputre
94c327c1ae
Removed unused "FunctionType::Kind::CallCode" from Types.h and all its usage
2018-08-23 13:09:00 +05:30
chriseth
c274af0770
Merge pull request #4825 from ethereum/expressionCompBareCall
...
More safeguards for (library) function types.
2018-08-16 14:38:44 +02:00
chriseth
455345871d
More safeguards for (library) function types.
2018-08-15 17:11:43 +02:00
Daniel Kirchner
7ca0aaaf6f
Add `staticcall
to
address
`.
2018-08-15 16:06:48 +02:00
chriseth
9328ea4c3c
Add abi.decode(bytes data, (...))
2018-08-15 10:45:16 +02:00
Alex Beregszaszi
ed52f422b7
Rename FunctionKind SHA3 to KECCAK256 (as the instruction was renamed in libevmasm)
2018-08-08 22:37:40 +01:00
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
Daniel Kirchner
b11e39e25e
Remove remaining instances of `fillRight
` left over from tuple wildcards assignments.
2018-08-07 18:51:53 +02:00
chriseth
71e26f6adb
Remove clone feature.
2018-08-07 11:10:50 +01:00
Alex Beregszaszi
eccc603291
FixedBytes(0) is invalid, do not check for it in ABIEncoderV2
2018-08-06 16:54:05 +02:00
Jesse Busman
3fcd62921e
Renamed FunctionType::hasEqualArgumentTypes to FunctionType::hasEqualParameterTypes
2018-08-06 13:05:06 +02:00
chriseth
009a55c82d
Merge pull request #4327 from ethereum/document-internals
...
Properly explain all the analsys steps in CompilerStack
2018-08-02 15:07:35 +02:00
chriseth
7a8a243eef
Isolate determining the encoding type into its own function.
2018-08-01 11:55:57 +01:00
Alex Beregszaszi
f74cff622d
Properly explain all the analsys steps in CompilerStack
2018-07-31 00:39:18 +01:00
Leonardo Alt
a2f03ea9e5
Fix abiDecode comment
2018-07-23 23:31:02 +02:00
Leonardo Alt
faa9c221d4
Changes in ExpressionCompiler
2018-07-18 19:51:24 +02:00
Daniel Kirchner
fc370591f0
Disallow multi variable declarations with mismatching number of values.
2018-07-12 20:33:51 +02:00
Alex Beregszaszi
0dd79bc172
Merge pull request #4479 from ethereum/fixFixedPointCrash
...
Fix handling of fixed point types in arithmetics.
2018-07-12 15:04:16 +01:00
chriseth
fa8102880f
Merge pull request #4428 from ethereum/enforce_staticcall_view
...
[BREAKING] Enforce STATICCALL for view and pure
2018-07-12 13:14:02 +02:00
chriseth
576f3ef18c
Merge pull request #4083 from ethereum/variable_stack_slot
...
[BREAKING] Allocate local variables according to their scope
2018-07-12 13:01:15 +02:00
chriseth
2b8091526f
Merge pull request #4472 from ethereum/complexCalldataArraysNotYetImplemented
...
Throw unimplemented exception for complex calldata arrays.
2018-07-11 23:48:42 +02:00
chriseth
7355298c2f
Fix handling of fixed point types in arithmetics.
2018-07-11 14:56:53 +02:00
Leonardo Alt
38026d3114
Use STATICCALL for view and pure
2018-07-11 14:45:22 +02:00
Cryptomental
140dbfdbd8
Code, Changelog, ReleaseChecklist: Fix typos.
...
Refs: #4442
2018-07-11 00:26:23 +02:00
chriseth
383b88793c
Throw unimplemented exception for complex calldata arrays.
2018-07-10 21:23:20 +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
chriseth
c8ac861832
Fix allocation of byte arrays.
2018-07-05 14:18:14 +02:00
chriseth
85b9d3927a
Merge pull request #4224 from ethereum/revert_wrong_calldata
...
[BREAKING] Revert if calldata has wrong size
2018-07-02 12:55:22 +02:00
Leonardo Alt
7763d21cc6
Revert if calldata is too short or points out of bounds
2018-06-26 10:27:48 +02:00
chriseth
a55e8c93ce
Save double encode call for sha3.
2018-06-25 17:17:18 +02:00
chriseth
23c4142005
Bare functions take single bytes argument.
2018-06-25 17:01:45 +02:00
chriseth
0e66a1ddde
Single bytes argument.
...
In 0.5.0 mode, only accept a single bytes argument for ``.call``,
``keccak256`` and others and do not pad when encoding.
2018-06-25 17:01:45 +02:00
Alex Beregszaszi
4cdb6c809a
Change comments
2018-06-14 09:31:28 +01:00
chriseth
014bbc6c97
Merge pull request #4272 from ethereum/assert-break-continue
...
Fail if break/continue statements are used outside for/while loops in ContractCompiler
2018-06-13 12:10:39 +02:00
chriseth
1dc28c065d
Properly pad data from calldata.
2018-06-12 18:51:40 +01:00
Daniel Kirchner
e84b55bd6f
Extend explanatory remark and argue using bitwise operations instead of rounding.
2018-06-12 09:32:19 +01:00
Daniel Kirchner
f33dc92cbd
Use proper SAR for signed right shifts and emulate on pre-constantinople.
2018-06-12 09:32:19 +01: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
Erik Kundt
fea0d116f7
Fixes assembly bug and adds tests to cover it.
2018-05-30 17:46:43 +02:00
Erik Kundt
98d52beba3
Adds syntax tests, documentation and changelog entry.
...
Refines comment for array utility function.
2018-05-30 17:43:20 +02:00
Erik Kundt
34b5eca1f8
Improves assembly and adds more tests.
2018-05-30 17:40:33 +02:00
Erik Kundt
7156a01acc
Implements pop() for byte arrays.
2018-05-29 12:53:02 +02:00
bitshift
e9dcfb0b62
Implements pop() for value type arrays.
2018-05-29 12:53:02 +02:00
Daniel Kirchner
f627dc77d0
Fix continue inside do-while.
2018-05-16 18:32:48 +02:00
Alex Beregszaszi
c03a29dea8
Fix revert with reason coming from a string variable
2018-05-09 17:53:17 +02:00
njwest
51b4dc3752
fixed grammar in error in CompilerUtils.cpp line 399, 'less variables.' should be 'fewer variables.'
2018-05-06 18:52:12 -04:00
daniel
aa1542a9e1
Change bytes to unsigned in FixedBytesType
2018-05-03 23:11:34 +01:00
chriseth
2968639406
Removed signed shift right from the utilities.
2018-04-30 20:34:43 +01:00
Alex Beregszaszi
52c9441879
Do not use SAR instead of SDIV in shifts because it rounds differently
2018-04-30 20:34:43 +01:00
Alex Beregszaszi
c3608eaf90
Use native shift instructions in ABIFunctions on Constantinople
2018-04-30 20:34:43 +01:00
Alex Beregszaszi
22bfd3da41
Use native shift instructions on Constantinople
2018-04-30 20:34:43 +01:00
Alexander Arlt
3ec667f59b
Add virtual destructor in LValue class.
2018-04-24 23:39:25 +02:00
Alex Beregszaszi
0201492bbf
Remove redundant cleanup for abi.encode.
2018-04-16 12:47:38 +02:00
chriseth
4c1d39b7a2
Properly force-clean for shortening bytesXX conversions.
2018-04-16 12:47:38 +02:00
chriseth
7054defdd6
Merge pull request #3364 from ethereum/revertWithReason
...
Revert with reason
2018-04-12 21:01:08 +02:00