Commit Graph

1057 Commits

Author SHA1 Message Date
Marenz
121fd40f74 Allow reading of immutables during construction time 2021-08-19 13:59:05 +02:00
chriseth
a4c94a1b5b Fixed inline assembly external identifier access. 2021-08-11 18:18:29 +02:00
hrkrshnn
892700d769 Tests for basefee as identifier in inline assembly
Also added basefee to `EVMVersion::hasOpcode(...)`
2021-08-11 10:46:40 +02:00
hrkrshnn
7f1a2be0fe Allow basefee as Yul identifier for EVMVersion < london
This was done to prevent basefee from being a breaking change. This change will be removed in 0.9.0.

TODO revert this commit in breaking.
2021-08-11 10:46:08 +02:00
hrkrshnn
43605d9299 Tests and Changelog for basefee. 2021-08-11 09:51:12 +02:00
chriseth
eaac16c779
Merge pull request #11590 from ethereum/disallow-non-hex-zero-and-fix-bytes32-literals-in-bytes-concat
Disallow non-hex zero literals and fix 32-byte hex literals in `bytes.concat()`
2021-06-29 16:34:26 +02:00
Kamil Śliwak
6a50d088a0 Fix ICE for 32-byte hex literals and zero literals in bytes.concat() by disallowing them 2021-06-29 14:48:42 +02:00
Kamil Śliwak
fa3696878b Fix crash when passing empty strings to bytes.concat() 2021-06-29 13:52:01 +02:00
Kamil Śliwak
ca0b1bf3f3 Fix crash when passing zero to bytes.concat() 2021-06-25 21:26:28 +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
chriseth
5b4a2f66e1 Directly restart processing calling functions. 2021-06-14 13:54:05 +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
Kamil Śliwak
362fc6650d Extra tests for shadowing within function parameter lists 2021-06-09 12:37:12 +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
Mathias Baumann
354f9d1015 Fix: Allow multiple @return tags on public state variables 2021-06-07 15:16: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
chriseth
8da5d6a854 Update test expectations. 2021-06-04 12:04:04 +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
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
hrkrshnn
2309ae3edd Added tests for internal or recursive types as event / error param
After converting the error about mapping parameter in event / error into a fatal type error, we were
missing tests that reached the "internal or recursive types" error.
2021-06-03 11:02:27 +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
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
Mathias Baumann
56ebea8b2f ControlFlowAnalyser: Also consider called functions in a flow 2021-06-01 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
hrkrshnn
f582d48f7b Error message: try-catch parameter cannot be in storage. 2021-05-31 11:25:08 +02:00
chriseth
e2d8005737 Add verbatim builtin. 2021-04-26 19:56:44 +02:00
Djordje Mijovic
ece42c07df Adding syntax test for bytes to bytesNN conversion. 2021-04-23 13:19:19 +02:00
Alex Beregszaszi
1be07c2b36 Trivial isoltest updates: missing // ---- at the end 2021-04-20 17:38:29 +02:00
Alex Beregszaszi
84c05d35f3 Trivial isoltest updates: normalized whitespace 2021-04-20 17:38:29 +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
11b227e33e
Merge pull request #11205 from ethereum/fix-docstring-bug
Fix docstring bug
2021-04-14 13:18:33 +02:00
chriseth
4912bfe639
Merge pull request #11229 from ethereum/antlrPath
Fix import paths in grammar and grammar testing details.
2021-04-12 16:30:41 +02:00
Daniel Kirchner
6fdfd8b62b Fix import path grammar and grammar testing details. 2021-04-12 14:54:36 +02:00
hrkrshnn
382c488edd Fix missing error when events are used without an emit statement.
Whenever there was a proper invocation of events, the compiler assumed that all the subsequent
invocations were proper.
2021-04-12 10:23:05 +02:00
hrkrshnn
e96a161115 Tests and changelog 2021-04-08 17:06:24 +02:00
chriseth
f04adde664 Allow hex string literals in Yul. 2021-04-08 15:03:33 +02:00
chriseth
47728a083f Add some bytecode reference tests. 2021-04-06 16:25:02 +02:00
Mathias Baumann
e590a99f39 Detect circular references for library and free functions 2021-03-30 23:06:30 +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
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
Alex Beregszaszi
e071884bbf Show proper error for misusing the custom natspec tag 2021-03-25 12:45:37 +00:00
Alex Beregszaszi
7a7ff7af2f Add one more test for invalid custom tag 2021-03-25 12:24:18 +00:00
Djordje Mijovic
e7da9f3d52 Adding syntax tests for bytes.concat. 2021-03-24 11:49:21 +01:00
chriseth
d2023f5f95 Check for invalid tags. 2021-03-02 16:53:31 +01:00
chriseth
2a25d04896
Merge pull request #11023 from ethereum/natspecparsinglocations
Provide locations for docstring parsing errors.
2021-03-02 14:03:42 +01:00
chriseth
f4050e81c6 Provide locations for docstring parsing errors. 2021-03-01 17:34:25 +01:00
chriseth
5e94fce7df Provide selector for some internal functions. 2021-03-01 16:19:59 +01:00
Kamil Śliwak
e87cd0afdf Check that there is an interface type before querying validity of location. 2021-02-24 11:22:40 +01:00
chriseth
1220d8df7b
Merge pull request #10998 from ethereum/clean-up-function-external-type-tests
Minor cleanup in syntax tests for function types
2021-02-23 17:59:26 +01:00
hrkrshnn
66d6d20f65 Converted hash collision error into a fatal type error.
The check is performed during ContractLevelChecker. However, the TypeChecker throws in certain cases
when it encounters functions, whose hashes collide.
2021-02-23 17:09:40 +01:00
Kamil Śliwak
cf2847afc4 Remove duplicate syntax tests for functions taking internal struct types 2021-02-23 16:46:49 +01:00
Kamil Śliwak
fc7a091bfb Move several tests related to function types from nameAndTypeResolution/ to more specific directories 2021-02-23 16:46:49 +01:00
chriseth
596e8dd9b6
Merge pull request #10959 from ethereum/assert-too-strict
Loosened up a really strict assert from ABIFunctions.cpp
2021-02-23 14:59:14 +01:00
chriseth
02b27bdc64
Merge pull request #10976 from ethereum/fix-boost-filesystem-bug
Tests: Do not remove filename from boost filesystem path for corner cases
2021-02-23 14:43:55 +01:00
chriseth
3dcba53595
Merge pull request #10993 from ethereum/fixModuleMemberNames
Fix module member names for importing with renaming.
2021-02-23 14:20:28 +01:00
chriseth
c91cffa4ec Fix module member names for importing with renaming. 2021-02-23 13:15:32 +01:00
chriseth
9c7b1e9c3f Detect assignment to function in inline assembly. 2021-02-23 11:47:12 +01:00
Bhargava Shastry
1ddfc7463a Tests: Do not remove filename from boost filesystem path for corner
cases.

Co-authored-by: Kamil Śliwak <kamil.sliwak@codepoets.it>
2021-02-22 10:32:41 +01:00
chriseth
78a097a012 Only warn about variables being shadowed in inline assembly. 2021-02-19 14:29:22 +01:00
hrkrshnn
f336a68009 Added syntax tests for constructors with function parameter 2021-02-17 17:12:02 +01:00
Alex Beregszaszi
346344dc7b Add missing test case for try/Catch 2021-02-16 12:33:55 +00:00
hrkrshnn
8167029dc1 Updating tests after improving Yul error reporting 2021-02-09 16:55:33 +01:00
Mathias Baumann
3a8a74cbc7 OverrideSpecifier: Check for null before dereferencing 2021-02-04 13:17:28 +01:00
hrkrshnn
ec57c791ef Fix infinite loop when accessing circular constants from inline assembly. 2021-01-26 09:22:05 +01:00
Mathias Baumann
07a1d230cd Fix missing error when accessing unintialized variables. 2021-01-25 14:44:15 +01:00
Kamil Śliwak
f0cb181545 Even more license tests 2021-01-18 16:17:06 +01:00
Kamil Śliwak
5677211471 SyntaxTest::filterObtainedErrors(): Remove hard-coded preamble to match changes in setupCompiler() 2021-01-18 16:17:06 +01:00
Alex Beregszaszi
6f1f0c5bbc Do not insert SPDX identifier if already present in SyntaxTest 2021-01-18 16:15:17 +01:00
Alex Beregszaszi
5bbb017915 Add more tests for the SPDX-License-Identifier 2021-01-18 16:15:17 +01:00
Alex Beregszaszi
e117c9516e Replace "pragma experimental ABIEncoderV2" in tests where appropriate
And add a few tests for "pragma abicoder".
2021-01-15 19:57:09 +00:00
Alex Beregszaszi
2c92f7641b Move all experimental pragma tests to syntaxTests/pragma 2021-01-15 19:12:32 +00:00
a3d4
35a25b107f Fix ICE caused by const structs with mappings 2021-01-12 18:39:54 +01:00
chriseth
99add1e4e5
Merge pull request #10710 from ethereum/implicit-conversion-bug
Disallow certain implicit conversions between integer types.
2021-01-12 15:42:12 +01:00
hrkrshnn
e107d51f46 Disallow certain implicit conversions between integer types.
Disallow implicit conversion from ``uintN`` and ``intM`` when ``M > N``, and by extension, explicit
conversion between the same types are also disallowed.
2021-01-12 08:23:47 +01:00
Alex Beregszaszi
8edfa26f0a Mark the empty version pragma as invalid 2021-01-04 19:28:36 +00:00
Djordje Mijovic
c41f996c7b Adding more tests for array copying.
Co-authored-by: Harikrishnan Mulackal <webmail.hari@gmail.com>
2020-12-28 13:16:24 +01:00
chriseth
04d83af1d2
Merge pull request #10492 from ethereum/arrayClearingDiffBaseSol2Yul
[Sol->Yul] Fixing array clearing when copying from storage to storage.
2020-12-22 15:15:03 +01:00
chriseth
b965446182 Catch panic. 2020-12-22 11:08:44 +01:00
Djordje Mijovic
8b6397e8fb Adding more syntax and semantic tests. 2020-12-21 15:30:49 +01:00
Alex Beregszaszi
b14a6a10cc Report meaningful error if parsing a version pragma failed 2020-12-18 11:50:37 +00:00
chriseth
3a23df6717 Merge remote-tracking branch 'origin/develop' into breaking 2020-12-16 16:56:45 +01:00
Kamil Śliwak
34e21c929a Fix a test for unicode direction override failing because of Windows line endings 2020-12-16 15:24:41 +01:00
chriseth
8f833f4e8f
Merge pull request #10618 from ethereum/develop
Merge develop into breaking.
2020-12-16 12:34:41 +01:00
chriseth
5c40fb060c Report illegal tokens in the Yul parser. 2020-12-16 12:20:07 +01:00
Christian Parpart
381c63ec99 Scanner: Generate error on inbalanced RLO/LRO/PDF override markers. 2020-12-15 18:40:51 +01:00