Commit Graph

915 Commits

Author SHA1 Message Date
chriseth
99fcf62736 Extract referencedDeclaration as helper. 2021-03-24 17:01:50 +01:00
Djordje Mijovic
1493326e48 Adding bytes.concat function type. 2021-03-24 11:49:21 +01:00
chriseth
d15ba987d1 Fix AST output if modifier invocation is base constructor call. 2021-03-24 11:24:26 +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
0519473059 Add "kind" field to ModifierInvocation AST json element. 2021-03-16 18:50:37 +01:00
hrkrshnn
ef0c4cc39f AST Import: For constructors, a public visibility is ignored. 2021-03-11 10:44:19 +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
Alexander Arlt
ae6996efc1 Fix issue with pop on storage array. 2021-02-23 14:26: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
Kamil Śliwak
7a85516b82 Remove contract reference from the call graph 2021-02-23 14:01:20 +01:00
chriseth
c91cffa4ec Fix module member names for importing with renaming. 2021-02-23 13:15:32 +01:00
Kamil Śliwak
54eb34d6fd Move call graphs from CompilerStack to ContractDefinitionAnnotation 2021-02-23 10:47:02 +01:00
Kamil Śliwak
6c28120f19 Move CallGraph structure to a separate module 2021-02-23 10:47:02 +01:00
Kamil Śliwak
13a9d21d88 FunctionType: Add assertions against missing type annotations
- This should make it easier to realize that one of the analysis phases has not been executed.
2021-02-23 10:29:12 +01:00
Christian Parpart
9ca389d6cd MemberList.Member's last argument (declaration) made mandatory to avoid accidental missing out during construction. 2021-02-11 10:46:14 +01:00
Christian Parpart
b0d3412fa9 Fixes missing EnumValue declaration in nativeMembers. 2021-02-11 10:46:14 +01:00
Christian Parpart
32ba5f5ae7 libsolidity: Extend the AST for named AST nodes in order to get precise locations for names.
The actual SourceLocation on an ASTNode is representing the whole
ASTNode whereas in an LSP (for example) you are also interested in the
SourceLocation of a name of a construct (e.g. variable decarlation, function definition, ...).

This also properly encodes non-existend sources as `-1` in the JSON output (eliminating the use of `numeric_limits<size_t>::max()`).
2021-02-10 18:13:09 +01:00
chriseth
fcdb5e0b40 Export statement documentation. 2021-02-09 17:33:01 +01:00
hrkrshnn
ec57c791ef Fix infinite loop when accessing circular constants from inline assembly. 2021-01-26 09:22:05 +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
Daniel Kirchner
eac2bcf72f Add range-v3. 2021-01-11 18:44:55 +01:00
chriseth
b965446182 Catch panic. 2020-12-22 11:08:44 +01:00
hrkrshnn
2fb191175b Disallow some explicit conversions to address payable
The following explicit conversions are disallowed:

1. uint160 -> address payable
2. bytes20 -> address payable
3. literals -> address payable (payable(0) is an exception)
2020-12-15 15:01:40 +01:00
chriseth
ffaf40950a
Merge pull request #10605 from ethereum/develop
Merge develop into breaking.
2020-12-15 14:01:01 +01:00
Djordje Mijovic
8aa4568b10 [Sol->Yul] Implementing conversion from calldata slices to memory arrays.
Co-authored-by: Kamil Śliwak <kamil.sliwak@codepoets.it>
2020-12-14 22:21:37 +01:00
Djordje Mijovic
0efd52a38e Allowing implicit conversion from calldata slice to memory and storage array types. 2020-12-14 22:21:37 +01:00
hrkrshnn
9bd778d728 Make msg.sender and tx.origin have type address
Previously both of them had type address payable. The idea is that anything that is not know to be
payable should be non-payable.
2020-12-14 16:55:48 +01:00
chriseth
28374447d2
Merge pull request #10582 from ethereum/addr-literal
Fix crash with oversized address literals
2020-12-14 12:14:28 +01:00
chriseth
561280a5cc Merge remote-tracking branch 'origin/develop' into breaking 2020-12-14 11:33:40 +01:00
Alex Beregszaszi
33ff2b16ff Fix crash with oversized address literals 2020-12-11 23:45:23 +00: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
7cd05bf603 Introduce block.chainid 2020-12-10 17:07:54 +00:00
Alex Beregszaszi
ad6739d0f6 Support address().codehash 2020-12-09 14:58:27 +00:00
chriseth
b18c76e34b Merge remote-tracking branch 'origin/develop' into breaking 2020-12-09 15:24:49 +01:00
Alex Beregszaszi
47b10fd751 Report warning if contract uses abicoder v1, but IR is requested 2020-12-09 01:20:58 +00: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
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
hrkrshnn
92ab32e532 Stricter explicit conversion between types.
A type can be converted to another if the conversion requires at most one of the following: sign,
width, kind (int, address, bytesXX, etc.) For example, the conversion `uint16(int8)` is now disallowed.
2020-12-03 16:49:53 +01:00
chriseth
9a5902f9d7 Merge remote-tracking branch 'origin/develop' into breaking 2020-12-02 12:28:02 +01:00
chriseth
390640f557
Merge pull request #10384 from ethereum/called_directly_feature
Use annotation.calledDirectly to simplify IR codegen
2020-12-01 15:07:02 +01:00
Mathias Baumann
c3da529a18 Mark expressions that are called directly in the annotations 2020-11-30 18:52:50 +01:00
Alex Beregszaszi
a22077f736 Rename AsmData -> AST
Also attempt to only include ASTForward where appropriate.
2020-11-25 17:58:02 +00:00
Alex Beregszaszi
3bce2a2294 Remove the legacy AST JSON output 2020-11-25 11:40:33 +00:00
chriseth
a0a02f2307 Merge remote-tracking branch 'origin/develop' into breaking 2020-11-23 19:28:08 +01:00