Commit Graph

4831 Commits

Author SHA1 Message Date
Christian Parpart
f561c1e90b [langutil] ParserBase: make advance() overridable and make sure it's used. 2021-06-23 12:53:25 +02:00
chriseth
c5923f7fcf Prevent calls to unimplemented modifiers. 2021-06-22 17:08:28 +02:00
Kamil Śliwak
98e83303b1 Remove assertions preventing calldata->calldata conversion when cleanup is needed 2021-06-22 16:10:16 +02:00
Djordje Mijovic
838f59fa5b Adding origin location notation to yul ir. 2021-06-21 18:48:20 +02:00
chriseth
0df8a38e55 Support metadata via IR. 2021-06-21 18:20:31 +02:00
Alex Beregszaszi
0e8e4eacd5 Pass on assembly instance from AssemblyStack to CompilerStack
This allows for generation of various output artifacts supported by the old codegen
2021-06-17 15:35:59 +02:00
Alex Beregszaszi
79794081eb Extract assemble() from compileContract() in CompilerStack 2021-06-17 15:28:22 +02:00
Kamil Śliwak
59957b18dc Make missing settings.optimizer.enabled key in Standard JSON equivalent to setting it to false 2021-06-15 16:06:22 +02:00
chriseth
b0a020ba97
Merge pull request #11530 from ethereum/IRgen-refactors
IR Codegen: Small refactoring & comment fixes
2021-06-14 14:33:39 +02:00
chriseth
9a681cf9fe
Merge pull request #11527 from ethereum/restartSerach
Directly restart processing calling functions.
2021-06-14 13:54:27 +02:00
chriseth
5b4a2f66e1 Directly restart processing calling functions. 2021-06-14 13:54:05 +02:00
Mathias Baumann
d7d64c3db5 IR Codegen: Small refactoring & comment fixes 2021-06-14 13:35:53 +02:00
chriseth
cf00faca33 Properly use AST node name also for secondary location. 2021-06-10 14:40:10 +02:00
chriseth
e5500b9f20
Merge pull request #11471 from ethereum/funcdef-unimplemented-modifier
Reports an error on unimplemented modifiers in a function definition.
2021-06-09 13:54:05 +02:00
Christian Parpart
a14ac1923d Fixes ICE when overriding an implemented modifier with an unimplemented one. 2021-06-09 13:15:20 +02:00
a3d4
f59145f21f Fix shadowing struct types by struct member names 2021-06-09 12:37:11 +02:00
a3d4
70b8b1c834 Do not warn about shadowing parameters in functions without implementation 2021-06-09 12:35:26 +02:00
Mathias Baumann
001a25db95 Fix crash in ControlFlowGraph related to free functions. 2021-06-09 11:10:33 +02:00
chriseth
3eaa37030a Fix infinite recursion in function call graph generator due to recursive constant references. 2021-06-08 16:39:30 +02:00
chriseth
7d8a4e63d8
Merge pull request #11491 from TerranCivilian/fix-10269
Remove unneeded include files
2021-06-07 20:15:20 +02:00
TerranCivilian
c15501eea9 Remove unneeded include files 2021-06-07 12:53:18 -04:00
chriseth
e3e6729f22
Merge pull request #11481 from ethereum/unify-resolve
Unify function call resolve function used in Analysis & Yul CodeGen
2021-06-07 16:54:13 +02:00
Mathias Baumann
6a0313c456 Unify function call resolve function used in Analysis & Yul CodeGen 2021-06-07 15:23:32 +02:00
Mathias Baumann
354f9d1015 Fix: Allow multiple @return tags on public state variables 2021-06-07 15:16:46 +02:00
Mathias Baumann
aae9d347aa Split DocStringParsing in two stages
one requiring type info in the next step
2021-06-07 14:49:46 +02:00
chriseth
1f8f1a3db9
Merge pull request #11484 from ethereum/fix-unreachable-code-anaysis
Fix revert pruner modifying function flows wrong
2021-06-04 12:44:35 +02:00
Mathias Baumann
d8ffdf11c8 Fix revert pruner modifying function flows wrong 2021-06-03 17:37:50 +02:00
chriseth
a8ffa6c08d
Merge pull request #11482 from ethereum/fixUnreachable2
Fix control-flow handling of modifiers without body.
2021-06-03 16:56:05 +02:00
chriseth
2e3ee4c156 Fix control-flow handling of modifiers without body. 2021-06-03 13:31:15 +02:00
hrkrshnn
c3eef8af91 Fix ICE related to receive function having parameters. 2021-06-03 13:08:57 +02:00
Daniel Kirchner
9be57546db
Merge pull request #11470 from ethereum/cacheVirtualLookup
Cache functions by name.
2021-06-03 11:51:08 +02:00
chriseth
a30cf6c3e8
Merge pull request #11480 from ethereum/event-mapping-fatal-error
Errors about nested mapping in event parameter are fatal.
2021-06-03 11:39:26 +02:00
chriseth
0d948ebf81 Cache functions by name. 2021-06-03 11:10:35 +02:00
hrkrshnn
cc915f023e Errors about nested mapping in event parameter are fatal.
(Also applies for error parameters.)
2021-06-03 11:02:27 +02:00
chriseth
c55d173a28
Merge pull request #11479 from ethereum/fix-ice-when-assigning-implicitly-convertible-function-array-to-storage
Fix ICE when assigning implicitly convertible function array to storage
2021-06-03 10:52:21 +02:00
chriseth
b00027724a
Merge pull request #11478 from ethereum/fix-ice-when-calling-invalid-external-function-type
Treat invalid external function type as a fatal error
2021-06-03 09:00:38 +02:00
chriseth
93936129f1
Merge pull request #11476 from ethereum/fix-ice-on-library-bound-to-literal
Fix ICE in IR when a library is bound to a literal
2021-06-03 08:58:00 +02:00
Kamil Śliwak
ccf658b0e8 Fix assertion preventing assignment of arrays of implicitly convertible function types 2021-06-03 08:56:02 +02:00
Kamil Śliwak
4a19c7e495 Treat invalid external function type as a fatal error to prevent the type from being used
- `returnParameterTypesWithoutDynamicTypes()` assumes it won't encounter such types.
2021-06-02 21:44:39 +02:00
Kamil Śliwak
d96cc3469a FunctionDefinition.resolveVirtual(): Skip unimplemented functions when lookup happens via super 2021-06-02 16:16:15 +02:00
Kamil Śliwak
67e87147b4 Extra asserts, test renaming, test for super in modifiers 2021-06-02 16:15:51 +02:00
Kamil Śliwak
3c7112ed2b Remove the assertion against functions bound to types for which should not be possible
- The list was wrong - we do support string and int literals
- The assertion was meant to guard against silently skipping over types for which there is no special handling. The current code handles everything in a generic way though and likely will not have to be adjusted for newly added types so the risk of that happening is low.
2021-06-02 13:59:42 +02:00
chriseth
4cbf9ff74c
Merge pull request #10143 from ethereum/issue-10084
ControlFlowAnalyser: Also consider called functions in a flow
2021-06-01 19:34:56 +02:00
Leo Alt
bf21cd400c Fix conversion from bytes to fixed bytes 2021-06-01 17:55:18 +02:00
Mathias Baumann
56ebea8b2f ControlFlowAnalyser: Also consider called functions in a flow 2021-06-01 15:54:37 +02:00
Leo Alt
547a6915ad Fix ICE on external calls from constructor 2021-06-01 14:21:48 +02:00
chriseth
0623658ddd Properly set source location of bare blocks. 2021-05-31 18:28:17 +02:00
Alex Beregszaszi
7eed8b69e9
Merge pull request #11459 from ethereum/yulFixedPointTypesAssertions
[Sol->Yul] Adding assertion in order to give better error messages for fixed point types
2021-05-31 15:32:14 +01:00
Djordje Mijovic
17eaa11657 [Sol->Yul] Adding assertion in order to give better error messages for fixed point types. 2021-05-31 15:54:37 +02:00
chriseth
3dfa68a574
Merge pull request #11456 from ethereum/ice-abstract-contract-mapping-constructor
Fix ICE related to mapping types in abstract contract constructor
2021-05-31 15:35:26 +02:00
hrkrshnn
138873d918 Fix ICE related to mapping types in abstract contract constructor 2021-05-31 14:56:49 +02:00
chriseth
6dd5bcd3f0
Merge pull request #11454 from ethereum/data-location-error
Error message: try-catch parameter cannot be in storage.
2021-05-31 14:31:01 +02:00
hrkrshnn
f582d48f7b Error message: try-catch parameter cannot be in storage. 2021-05-31 11:25:08 +02:00
chriseth
29a995b937
Merge pull request #11433 from ethereum/panic-dedup
Insert a call to panic function in legacy codegen (and not inline it every single time)
2021-05-31 11:23:30 +02:00
Alex Beregszaszi
c436785686 Insert a call to panic function in legacy codegen (and not inline it every single time) 2021-05-27 18:29:46 +01:00
chriseth
d305c219d8 Fix namespace styles. 2021-05-27 17:41:04 +02:00
Leo Alt
f7b045b886 review 2021-05-26 22:12:49 +02:00
Leo Alt
95f973e08a Fix gasleft variable name 2021-05-26 22:12:49 +02:00
Leo Alt
daea5f886d Fix CHCSmtLib2Interface 2021-05-26 22:12:49 +02:00
Alex Beregszaszi
bf2c82adca Document the panic function of library deployment 2021-05-26 15:51:46 +01:00
Alex Beregszaszi
75c72cd54d Properly support inliner in settings.optimizer.details 2021-05-20 20:22:34 +01:00
Alex Beregszaszi
d61f21276d
Merge pull request #11399 from ethereum/hex-conversion
Turn toCompactHexWithPrefix into a template and support unsigned types
2021-05-18 11:36:43 +01:00
Martin Blicha
9c98ab59f0 SMTChecker: fixed struct constructor where FixedBytes member is initialized with a string literal 2021-05-17 13:52:37 +02:00
Alex Beregszaszi
6dae6583af Turn toCompactHexWithPrefix into a template and support unsigned types
This should help with boost::multiprecision versions where explicit unsigned/enum conversion to bigint do not exists (such as boost 1.76)
2021-05-15 23:33:29 +01:00
Leonardo Alt
4b2ccf2f37 Abstract function smtchecker natspec 2021-05-11 15:30:19 +02:00
Leo Alt
e2959ce55c Assign cast from constants directly 2021-05-11 14:07:09 +02:00
Bhargava Shastry
a0795cbc98 Use a local instead of a temporary as an argument to valueOrDefault 2021-05-10 11:36:39 +02:00
Daniel Kirchner
6104ac1cdf Remove more imports of ranges namespace. 2021-05-07 15:42:17 +02:00
Daniel Kirchner
c69add1682 Remove import of ranges namespace. 2021-05-07 13:44:14 +02:00
chriseth
518629a8f6
Merge pull request #10768 from ethereum/copyLiteralToStorageSol2Yul
[Sol->Yul] Adding util function to copy literal to storage.
2021-05-06 10:44:39 +02:00
Djordje Mijovic
f0c5cdca9f [Sol->Yul] Adding util function to copy literal to storage.
Co-authored-by: Daniel Kirchner <daniel@ekpyron.org>

Co-authored-by: chriseth <chris@ethereum.org>
2021-05-05 11:33:03 +02:00
chriseth
72fc4d4a32 Introduce ceil division helper function. 2021-05-05 11:12:10 +02:00
chriseth
9d156b52c4
Merge pull request #8868 from ethereum/functionEntryPoints
Note function entry points.
2021-05-05 11:08:44 +02:00
Djordje Mijovic
3e5f5fccf9 [Sol->Yul] Adding cleanUpArrayEnd util function.
Co-authored-by: chriseth <chris@ethereum.org>

Co-authored-by: Alex Beregszaszi <alex@rtfs.hu>

Co-authored-by: Kamil Śliwak <kamil.sliwak@codepoets.it>

Co-authored-by: Alex Beregszaszi <alex@rtfs.hu>

Co-authored-by: Kamil Śliwak <kamil.sliwak@codepoets.it>
2021-05-05 08:53:34 +02:00
chriseth
f9c94d7c42 Note function entry points. 2021-05-04 17:15:13 +02:00
chriseth
faca036837
Merge pull request #11294 from ethereum/yulAstDebugDataRefactor
Removing location in favor of debugData in yul AST structures
2021-05-04 17:05:40 +02:00
Djordje Mijovic
e404b6e7a6 Refactoring yul source locations. 2021-05-04 16:05:23 +02:00
chriseth
62355aead3 Respect memory model for revert. 2021-05-03 18:23:41 +02:00
Leonardo
fe4822a1d2
Merge pull request #11333 from ethereum/smt_fix_free_functions
[SMTChecker] Fix ICE in free functions
2021-05-03 14:59:00 +02:00
chriseth
d721bbe504 Respect memory model in forwarding revert inside catch. 2021-05-03 12:19:46 +02:00
Leo Alt
1642c10f6e Fix ICE in free functions 2021-05-03 10:57:11 +02:00
chriseth
79acebe46f Allocate for returning runtime code. 2021-04-29 16:40:51 +02:00
chriseth
b06a09fd82 Fix forwarding revert. 2021-04-29 14:58:10 +02:00
Kamil Śliwak
5023cef382 OptimiserSettings: Add preset() and OptimisationPreset enum 2021-04-27 14:06:44 +02:00
chriseth
f72592549b
Merge pull request #11110 from ethereum/issue_10475_isoltest_external_sources
[isoltest] Add support for external sources.
2021-04-27 10:54:39 +02:00
Alex Beregszaszi
9d5b4150d4 Throw StackTooDeep earlier (with sourcelocatiom) for inline assembly issues 2021-04-26 20:11:50 +01:00
Alexander Arlt
481971cbcf [isoltest] Add support for external sources. 2021-04-26 08:27:30 -05:00
Mathias Baumann
5f313ee52a ControlFlowAnalyzer: Use temporary reference for more readable code 2021-04-26 13:24:17 +02:00
chriseth
659da4bdc7
Merge pull request #11047 from ethereum/bytesToBytesNNConversion
Bytes to bytesNN conversion
2021-04-26 11:51:41 +02:00
Alex Beregszaszi
e39433198d Remove the usage of boost::noncopyable
Prior to this half of the codebase used explicit deleted copy constructors, the others used boost::noncopyable.
2021-04-23 14:57:01 +01:00
Djordje Mijovic
cbb7e53b22 Activating bytes to bytesNN for legacy codegen by calling yul util function. 2021-04-23 13:30:19 +02:00
Djordje Mijovic
52538558b1 [Sol->Yul] Implementing bytes to bytesNN for IR codegen.
Co-authored-by: Alex Beregszaszi <alex@rtfs.hu>
2021-04-23 13:30:15 +02:00
Djordje Mijovic
b40c3bcc32 Allowing conversion from bytes to bytesNN in type checker. 2021-04-23 13:19:19 +02:00
hrkrshnn
1f5b874eaf Optimizer context has parameter expectedExecutionsPerDeployment 2021-04-22 17:27:57 +02:00
Đorđe Mijović
8840fb6ffd
Merge pull request #11270 from ethereum/addingBoundsByteArraySolYul 2021-04-22 15:41:32 +02:00
Alex Beregszaszi
4855fca802 Remove dead code in NatSpec 2021-04-22 13:26:11 +01:00
Djordje Mijovic
3a4233f3ad [Sol->Yul] Adding bounds check when increasing size of byte array. 2021-04-22 11:42:46 +02:00
Leonardo
7bbf3a694b
Merge pull request #11261 from ethereum/smt_choose_target
[SMTChecker] Add option to choose contracts to be analyzed
2021-04-21 13:11:33 +02:00
Djordje Mijovic
0dd59fa0a2 [Sol->Yul] Remove index access from byte array pop function to optimize it. 2021-04-21 11:01:18 +02:00
Leonardo Alt
dd1865873e Choose contracts to be analyzed by the SMTChecker 2021-04-21 10:34:14 +02:00
chriseth
cf7f814a4e
Merge pull request #10921 from ethereum/issue-10881
Natspec: Don't copy from base function if return parameters differ
2021-04-20 15:33:48 +02:00
Leonardo Alt
095d337140 Basic support to free constants 2021-04-19 19:23:18 +02:00
Leonardo Alt
4e34359063 Basic support to free functions 2021-04-19 19:23:18 +02:00
Leonardo Alt
e3abde43f5 Change settings.modelChecker.targets to take an array instead of string 2021-04-19 17:53:03 +02:00
Mathias Baumann
1737bd7ded Natspec: Don't copy from base function if return parameters differ 2021-04-19 15:20:30 +02:00
chriseth
8eb0d5edf6 Export used errors in the AST. 2021-04-19 14:15:50 +02:00
Christian Parpart
81c7b30a6a
Merge pull request #11234 from ethereum/fix-file-reader-compiler-stack-source-unit-name-mismatch
Use identical source unit names in FileReader and CompilerStack
2021-04-14 13:46:14 +02:00
chriseth
11b227e33e
Merge pull request #11205 from ethereum/fix-docstring-bug
Fix docstring bug
2021-04-14 13:18:33 +02:00
Kamil Śliwak
0922d60ba6 FileReader: More accurate description of FileReader::readFile() and its arguments 2021-04-13 13:26:01 +02:00
Kamil Śliwak
6a41b417a3 FileReader: Store files loaded by the callback under their source unit name 2021-04-13 13:25:59 +02:00
chriseth
72d0a56a72 Fix array decoding offset overflow. 2021-04-12 13:43:51 +02:00
chriseth
32b8332867 Refactor array decoding. 2021-04-12 13:43:51 +02:00
Leonardo Alt
b753cb6120 Deprecate pragma experimental SMTChecker 2021-04-08 21:03:38 +02:00
chriseth
0cc0cabd30
Merge pull request #11224 from ethereum/lastAllocationUnbounded
Use unbounded allocation before returning.
2021-04-08 19:32:40 +02:00
Daniel Kirchner
96c8123b6b Use unbounded allocation before returning. 2021-04-08 18:37:24 +02:00
hrkrshnn
b7795b86c1 Allow notice tag for non-public state variable.
This won't be part of NatSpec JSON, but will show up under documentation node in AST.
2021-04-08 17:06:14 +02:00
hrkrshnn
39e3da1905 Allow NatSpec documentation for local variable declarations
This won't be part of NatSpec JSON, but in AST, under the field documentation.
2021-04-08 17:06:14 +02:00
chriseth
6d6112a81b
Merge pull request #11210 from anurag-git/issue_10738-2
Use range-v3 loops(transform)
2021-04-08 14:56:15 +02:00
anurag4u80
b2ca7916aa Replaced boost::adaptors::transformed 2021-04-08 17:38:14 +05:30
Christian Parpart
257672e56f Extract file reading logic from CommandLineInterface into FileReader class. 2021-04-06 17:10:43 +02:00
Christian Parpart
3490577140 Extract import-file remapping logic out of CompilerStack into ImportRemapper. 2021-04-06 14:28:53 +02:00
Christian Parpart
30588a90eb CompilerStack: assemblyString doesn't need to receive sourceCodes map as copy. 2021-04-06 14:28:01 +02:00
chriseth
98a8640928
Merge pull request #11203 from anurag-git/issue_10738-1
Use range-v3 loops (reverse, keys, values)
2021-04-01 12:19:40 +02:00
anurag4u80
bbcdddeed9 Replaced keys, values and reverse with ranges 2021-03-31 23:33:04 +05:30
Martin Blicha
330fb8f4d0 [SMTChecker] Assignment refactoring 2021-03-31 13:36:50 +02:00
Leonardo
78d94737a4
Merge pull request #11188 from blishko/issue-11181
[SMTChecker] Fix crash when analysing try-catch clauses with function call.
2021-03-31 11:24:36 +02:00
Mathias Baumann
e590a99f39 Detect circular references for library and free functions 2021-03-30 23:06:30 +02:00
chriseth
79d7466e19 NatSpec for errors. 2021-03-30 21:16:58 +02:00
chriseth
517cd17a6f Add errors to the ABI. 2021-03-30 21:16:58 +02:00
chriseth
e877e2bba7 Use all referenced errors. 2021-03-30 21:15:46 +02:00
chriseth
1057fd5355 Take revert statement into account in control flow graph. 2021-03-30 21:15:46 +02:00
chriseth
d5669696d5 Code generation for errors. 2021-03-30 21:15:46 +02:00
chriseth
b552e5aeeb AST import and export for revert statement. 2021-03-30 21:15:46 +02:00
chriseth
fb67051467 Revert statement. 2021-03-30 21:15:46 +02:00
chriseth
b04b189959 Syntax for custom errors. 2021-03-30 21:15:18 +02:00
Martin Blicha
2d231f1859 [SMTChecker] Changed SMTEncoder::mergeVariables to work regardless which branch has been visited first 2021-03-30 20:35:44 +02:00
Leonardo Alt
ba97d6ac4e Add local vars to cex 2021-03-30 17:55:21 +02:00
Leonardo Alt
dbd067d6db Report out of bounds index access 2021-03-30 10:28:48 +02:00
chriseth
bb49bc5892
Merge pull request #10418 from ethereum/function-specializer
Function specializer
2021-03-29 15:48:01 +02:00
hrkrshnn
45a3747701 Added FunctionSpecializer to the optimization suite 2021-03-29 11:02:18 +02:00
Leonardo Alt
d1db41a5c8 Fix target warning order nondeterminism 2021-03-26 12:13:52 +01:00
Martin Blicha
85358dfe30 [SMTChecker] Do not create targets for contracts that cannot be deployed 2021-03-25 15:38:37 +01:00
Leonardo
7e1be52281
Merge pull request #11165 from blishko/smt-abi-no-args
[SMTChecker] Fix ICE on ABI functions with no arguments
2021-03-25 15:21:57 +01:00
Alex Beregszaszi
e071884bbf Show proper error for misusing the custom natspec tag 2021-03-25 12:45:37 +00:00
Martin Blicha
5293f05ee3 [SMTChecker] Fix ICE on ABI functions with no arguments 2021-03-25 13:28:29 +01:00
chriseth
4080748b1d
Merge pull request #11157 from ethereum/extractReferencedDeclaration
Extract referencedDeclaration as helper.
2021-03-25 11:02:20 +01:00
chriseth
99fcf62736 Extract referencedDeclaration as helper. 2021-03-24 17:01:50 +01:00
Martin Blicha
98446782e2 [SMTChecker] Fix compound assignment to push 2021-03-24 14:54:13 +01:00
Leonardo
13d3b35141
Merge pull request #11116 from blishko/issue-10985
[SMTChecker] Handle InaccessibleDynamicType
2021-03-24 14:39:24 +01:00
Martin Blicha
852e877ae7 [SMTChecker] Handle InaccessibleDynamicType 2021-03-24 11:53:06 +01:00