Commit Graph

1288 Commits

Author SHA1 Message Date
chriseth
c5923f7fcf Prevent calls to unimplemented modifiers. 2021-06-22 17:08:28 +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
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
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
hrkrshnn
cc915f023e Errors about nested mapping in event parameter are fatal.
(Also applies for error parameters.)
2021-06-03 11:02:27 +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
Mathias Baumann
56ebea8b2f ControlFlowAnalyser: Also consider called functions in a flow 2021-06-01 15:54:37 +02:00
hrkrshnn
138873d918 Fix ICE related to mapping types in abstract contract constructor 2021-05-31 14:56:49 +02:00
chriseth
d305c219d8 Fix namespace styles. 2021-05-27 17:41:04 +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
Djordje Mijovic
e404b6e7a6 Refactoring yul source locations. 2021-05-04 16:05:23 +02: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
b40c3bcc32 Allowing conversion from bytes to bytesNN in type checker. 2021-04-23 13:19:19 +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
anurag4u80
b2ca7916aa Replaced boost::adaptors::transformed 2021-04-08 17:38:14 +05:30
anurag4u80
bbcdddeed9 Replaced keys, values and reverse with ranges 2021-03-31 23:33:04 +05:30
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
Djordje Mijovic
840df80dac Check if all types in bytes.concat are fixed bytes or byte array. 2021-03-24 11:49:21 +01:00
Martin Blicha
e0b7c2c125 Fix compilation on develop 2021-03-24 09:40:02 +01:00
chriseth
e3ea5c631e
Merge pull request #11136 from ethereum/refactor-typepointer
Replace `TypePointer` with `Type const*`
2021-03-23 18:32:38 +01:00
Mathias Baumann
e197ebbdd1 Replace TypePointer with Type const* 2021-03-23 11:47:19 +01:00
Mathias Baumann
bccedf791b Add creationCode/runtimeCode contract creation detection to call graph 2021-03-22 15:44:23 +01:00
chriseth
d2023f5f95 Check for invalid tags. 2021-03-02 16:53:31 +01:00
chriseth
5690020d88 Allow custom natspec tags. 2021-03-02 16:13:28 +01:00
chriseth
f4050e81c6 Provide locations for docstring parsing errors. 2021-03-01 17:34:25 +01:00
chriseth
16db3a84f1 Fix call graph with respect to constants. 2021-02-25 16:00:53 +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
e33c058a60
Merge pull request #10896 from ethereum/issue-10870
Fix issue with pop on storage array.
2021-02-23 17:49:17 +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
Alexander Arlt
ae6996efc1 Fix issue with pop on storage array. 2021-02-23 14:26:55 +01:00
Kamil Śliwak
f58b64800f Fix 'switch' style in FunctionCallGraph 2021-02-23 14:02:35 +01:00
Kamil Śliwak
7a85516b82 Remove contract reference from the call graph 2021-02-23 14:01:20 +01:00
Kamil Śliwak
6c28120f19 Move CallGraph structure to a separate module 2021-02-23 10:47:02 +01:00
Kamil Śliwak
74ef7dd790 FunctionCallGraph: operator<< for printing nodes in an unambiguous way 2021-02-23 10:46:28 +01:00
Mathias Baumann
4c1f8d69f9 Implement a Function Call Graph 2021-02-23 10:46:28 +01:00
chriseth
78a097a012 Only warn about variables being shadowed in inline assembly. 2021-02-19 14:29:22 +01:00
Alex Beregszaszi
f766700000 Remove unreachable warning for shift/exp operator 2021-02-16 13:17:58 +00:00
Alex Beregszaszi
efe3199981 Remove unreachable assertion for import resolution 2021-02-16 12:55:01 +00:00
Alex Beregszaszi
fd9050614a Remove untriggerable errors on variadic calls (which have been removed) 2021-02-15 22:45:57 +00: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
chriseth
6eea2f5c08
Merge pull request #9959 from a3d4/fix-ice-struct-with-mapping-assignment
Fix ICE caused by const structs with mappings
2021-01-13 15:19:02 +01:00
a3d4
35a25b107f Fix ICE caused by const structs with mappings 2021-01-12 18:39:54 +01:00
chriseth
24aded266e Dereference. 2021-01-12 14:28:27 +01:00
chriseth
7487a7d927 Use drop_exactly. 2021-01-12 14:01:10 +01:00
chriseth
b9de0c6155 Use zip. 2021-01-11 20:54:28 +01:00
chriseth
b965446182 Catch panic. 2020-12-22 11:08:44 +01:00
Alex Beregszaszi
b14a6a10cc Report meaningful error if parsing a version pragma failed 2020-12-18 11:50:37 +00:00
hrkrshnn
f30c7cbac8 All explicit address conversions return a non-payable address 2020-12-14 18:41:27 +01:00
hrkrshnn
e1a95cfd42 Disallow conversions from literals to payable address
To get a payable address, one has to go through address. For example, `payable(address(0))`.
2020-12-14 16:55:48 +01:00
chriseth
e1e1337aca Move functions into anonymous namespace. 2020-12-14 14:18:03 +01:00
chriseth
561280a5cc Merge remote-tracking branch 'origin/develop' into breaking 2020-12-14 11:33:40 +01:00
Alex Beregszaszi
7b347b9ec2 Introduce address(...).code 2020-12-11 03:00:30 +00:00
Alex Beregszaszi
fa37e69c25 Improved error messages when converting to/from builtin functions 2020-12-10 22:38:15 +00:00
Alex Beregszaszi
bd641a5206 Enable more C++ compiler warnings 2020-12-10 21:03:58 +00:00
Alex Beregszaszi
7cd05bf603 Introduce block.chainid 2020-12-10 17:07:54 +00:00
chriseth
482bda6887 Merge remote-tracking branch 'origin/develop' into breaking 2020-12-10 12:15:52 +01:00
Mathias Baumann
37cc795034 Fix segfault for empty @return tags in modifiers 2020-12-10 11:54:40 +01:00
chriseth
3f748bbb94
Merge pull request #10336 from ethereum/enablecoderv2bydefault
[BREAKING] Enable ABI coder v2 by default.
2020-12-09 18:05:07 +01:00
chriseth
870fd24723
Merge pull request #9888 from ethereum/account-hash
Support address().codehash
2020-12-09 17:40:56 +01:00
Alex Beregszaszi
ad6739d0f6 Support address().codehash 2020-12-09 14:58:27 +00:00
chriseth
251f2a4d93 Fix bug in constant evaluator. 2020-12-09 15:50:53 +01:00
chriseth
d525a8bccb Enable ABI coder v2 by default. 2020-12-09 15:25:15 +01:00
chriseth
806453aca9 Merge remote-tracking branch 'origin/develop' into breaking 2020-12-08 21:00:09 +01:00
Alex Beregszaszi
7e88ba8da0 Enable the -Wconversion warning 2020-12-08 16:45:24 +00:00
Djordje Mijovic
acb93f3a97 Disallowing usage of msg.data in receive() function. 2020-12-08 11:49:20 +01:00
chriseth
a3c5d37d02 Merge remote-tracking branch 'origin/develop' into breaking 2020-12-07 17:13:48 +01:00
chriseth
254119d146
Merge pull request #10506 from ethereum/superInLibs
Make super unavailable in libraries.
2020-12-07 14:36:42 +01:00
chriseth
b86c91d1a3 Make super unavailable in libraries. 2020-12-07 13:59:50 +01:00
Alex Beregszaszi
1e2bfbd6b2 Enable the -Wextra-semi warning 2020-12-04 17:21:19 +01:00
chriseth
4be9b409de Remove unary plus. 2020-12-04 15:14:25 +01:00
Christian Parpart
c5d172c058 Reimplement constant evaluator. 2020-12-04 15:14:25 +01:00
chriseth
49bde69afa Move computation of constants out of types.cpp 2020-12-04 15:14:25 +01:00
chriseth
d50676ecb0
Merge pull request #10451 from ethereum/noTypeSuper
No type super
2020-12-02 15:56:41 +01:00
chriseth
52c49aebe8 Disallow meta type on super. 2020-12-02 15:43:18 +01:00