chriseth
d5e9271592
Merge pull request #7350 from ethereum/array-length-rvalue
...
Make `length` member read-only
2019-11-21 19:22:42 +01:00
Leonardo Alt
389da5228e
Merge remote-tracking branch 'origin/develop' into merge_develop_060
2019-11-20 12:27:40 +01:00
Leonardo Alt
be849b3c47
Replace boost::variant by std::variant in libyul
2019-11-19 17:23:18 +01:00
Erik Kundt
ecaed1030f
Makes array length access read-only.
2019-11-19 16:09:21 +01:00
chriseth
6797879128
Merge pull request #7647 from ethereum/virtual-5424
...
Implement virtual keyword
2019-11-19 13:21:27 +01:00
chriseth
216e1749f4
Merge remote-tracking branch 'origin/develop' into develop_060
2019-11-14 13:42:46 +01:00
chriseth
766309b6e4
Merge pull request #7713 from ethereum/no-lib-instance-7625
...
Disallow variables of library types
2019-11-14 13:39:56 +01:00
Mathias Baumann
0891b9451b
Disallow variables of library types
2019-11-14 13:20:31 +01:00
chriseth
a667384517
Merge pull request #7712 from ethereum/fixIstanbulAsmParsing
...
Fix assembly parsing by passing evm version.
2019-11-14 13:20:15 +01:00
chriseth
b099374d8c
Fix assembly parsing by passing evm version.
2019-11-14 13:06:36 +01:00
Mathias Baumann
5b8ff78176
Implement virtual keyword
2019-11-14 11:49:39 +01:00
chriseth
06588cde76
Reconstruct function definition for magic variables in overload error message.
2019-11-14 10:13:22 +01:00
Mathias Baumann
15df2b30d7
List candidates when overload failed
...
fixes #7146
2019-11-13 15:54:36 +01:00
Daniel Kirchner
8148619d5b
Merge branch 'develop' into develop_060
2019-11-12 10:32:41 +01:00
Mathias Baumann
e35a23bbcc
Add `switch (..)
to style checker
2019-11-11 17:44:21 +01:00
Mathias Baumann
e643c4ca28
Add `while (..)
to style checker
2019-11-11 17:28:41 +01:00
Christian Parpart
f15d47f165
Yul: Remove obsoleted FunctionalInstruction.
2019-11-11 16:04:39 +01:00
Alexander Arlt
ce0cef7cbc
Output which functions are not implemented
2019-11-08 14:06:57 -05:00
Daniel Kirchner
0556f64722
Analyze inline assembly variable declarations for invalid or shadowing names.
2019-11-07 13:04:37 +01:00
chriseth
5388c919f0
Some changes to "abstract".
2019-11-05 13:55:31 +01:00
Daniel Kirchner
3321fc56ea
Split fallback function and introduce "fallback()" and "receive()" syntax.
2019-11-04 17:17:58 +01:00
chriseth
5392532d70
Fix override error message.
2019-11-04 13:37:23 +01:00
Alexander Arlt
f3f652e290
Update TypeChecker.cpp
2019-11-01 14:54:47 -05:00
Alexander Arlt
c908c16acd
Remove InternalCompilerError on abstract contract instantiation.
2019-11-01 14:54:47 -05:00
Alexander Arlt
62950a9234
Support for abstract contracts.
2019-11-01 14:54:47 -05:00
Mathias Baumann
6c6a9054b2
Implement override checking
2019-10-30 17:31:33 +01:00
Mathias Baumann
5ff02c12e2
Add reference to contract in FunctionDefinition annotation
2019-10-30 17:31:33 +01:00
Mathias Baumann
20e227afb5
Ensure list of overrides consists of contracts
2019-10-30 17:31:33 +01:00
Mathias Baumann
f4c40080c4
Move if-condition to function for re-use
2019-10-30 17:31:33 +01:00
chriseth
ceb8ee9124
[Yul] leave statement.
2019-10-29 14:32:16 +01:00
chriseth
edf1e83fda
Merge remote-tracking branch 'origin/develop' into develop_060
2019-10-28 15:21:49 +01:00
chriseth
607bf24afe
Merge pull request #7386 from ethereum/060-strict-inline-assembly
...
Defaulting to strict inline assembly (instead of loose)
2019-10-28 12:48:58 +01:00
chriseth
9719f099aa
Merge pull request #7551 from ethereum/060-cxx17-std-optional
...
Use `std::optional<>` rather than `boost::optional<>`
2019-10-28 12:17:31 +01:00
chriseth
07c67b98f6
Merge remote-tracking branch 'origin/develop' into HEAD
2019-10-28 12:12:52 +01:00
Christian Parpart
df729b3084
Make use of C++17 std::optional<> instead of boost::optional<>.
2019-10-28 11:39:30 +01:00
Henry Lee
24cbb4dd17
Treat magic variables as unknown identifiers in inline assembly
...
This fixes #4575 . For keywords such as 'super' and 'this', will be
treated as unknown identifiers.
2019-10-28 14:59:50 +11:00
Christian Parpart
3c1d12b16c
Assembly: Remove errorTypeForLoose property from AsmAnalyzer.
2019-10-25 15:01:26 +02:00
Christian Parpart
dc2adb3d9d
Assembly: Removing EVMDialect::looseAssemblyForEVM().
2019-10-25 15:01:26 +02:00
Christian Parpart
e23998fc6e
Assembly: Remove Label instruction.
2019-10-25 15:01:25 +02:00
Christian Parpart
5e8d348f66
Assembly: Remove StackAssignment instruction.
2019-10-25 15:01:25 +02:00
Mathias Baumann
8c5d1da5a5
Check for use of modifiers in invalid contexts
2019-10-23 12:36:20 +02:00
Mathias Baumann
ad7cf42aad
Add missing dots in deprecation warning
2019-10-23 12:23:21 +02:00
Mathias Baumann
6ac12afd06
Disallow call of same-class-ctor as modifier
2019-10-23 10:29:41 +02:00
chriseth
f884373142
Merge branch 'origin/develop' into develop_060
2019-10-02 16:29:36 +02:00
Christian Parpart
00d7dac15f
Fixes source location in warning for shadowing import delcarations.
2019-09-30 11:45:46 +02:00
Leonardo
ca714a2d3d
Merge pull request #7485 from ethereum/develop
...
Merge develop into develop_060
2019-09-26 15:43:12 +02:00
chriseth
ca21659749
Fix error message about accessing storage pointers.
2019-09-24 10:52:02 +02:00
chriseth
8e736a9f49
Type Checker for try/catch.
2019-09-23 17:22:56 +02:00
chriseth
b5bc52f2a7
Control flow for try statements.
2019-09-23 17:22:56 +02:00
Leonardo Alt
43d6e00b14
Add push() for dynamic storage arrays
2019-09-17 13:47:33 +02:00
Daniel Kirchner
4782c800ec
Initial introduction of array slices with partial implementation for dynamic calldata arrays.
2019-09-13 10:57:53 +02:00
Leonardo Alt
5cfe0b7670
Allow explicit conversion from address to address payable
2019-09-09 23:46:00 +02:00
krk
33f7f960cf
Allow exponentials with signed base and unsigned power.
2019-09-04 17:32:47 +02:00
Daniel Kirchner
4354ef2ef4
Add update suggestion.
2019-08-19 14:58:05 +02:00
chriseth
c047803b80
Change BreadthFirstSearch to use value types instead of pointers.
2019-08-15 16:10:10 +02:00
Daniel Kirchner
e545103ec8
Extract reasonOfFailure to lambda function.
2019-08-14 17:59:48 +02:00
Daniel Kirchner
b0a5666b43
Better error messages when writing to expressions that cannot be written to.
2019-08-14 17:59:48 +02:00
chriseth
57125de9ef
Remove ContainsMSize from side-effect-collector.
2019-08-13 13:34:33 +02:00
chriseth
9cb9021c36
Cope with constants without value in inline assembly.
2019-07-09 11:12:13 +02:00
chriseth
18072586c9
Remove trailing whitespace in error message.
2019-07-08 14:28:38 +02:00
chriseth
2b91022b25
Fix view/pure checker for access to base.
2019-07-03 11:19:57 +02:00
chriseth
cdd137e3d1
Support constant numbers in inline assembly.
2019-07-02 14:01:05 +02:00
Leonardo Alt
b7634faa3d
Improve error message for delegatecall.value
2019-06-06 12:55:12 +02:00
chriseth
df96648b1c
Do not allow msize in inline assembly if the Yul optimizer is active.
2019-05-28 12:54:33 +02:00
chriseth
0291abf10f
Merge pull request #6818 from ethereum/alwaysUseBuiltins
...
Provide builtin functions even in loose assembly mode.
2019-05-23 12:29:12 +02:00
chriseth
9a00729ce7
Provide dialect to Parser and InlineAssembly AST nodes.
2019-05-23 00:24:58 +02:00
chriseth
7506b5752a
Do not require payable for callvalue instruction.
2019-05-22 11:30:29 +02:00
Erik Kundt
07744dbd12
Throws error on library calling itself externally.
2019-05-02 12:41:07 +02:00
Mathias Baumann
cf35e5ba02
Issue warning for variables called super
or this
2019-05-02 11:30:24 +02:00
chriseth
0bfd587363
Merge pull request #6527 from rocky/move-SemVerHandler
...
Move SemVerHandler to analysis to parsing to increase modularity...
2019-04-18 13:00:45 +02:00
rocky
b424446c5f
Move SemVerHandler to analysis to parsing to increase modularity...
...
If ever you want to separate building analysis from scanning/parsing/ast, this will help.
2019-04-17 10:13:42 -04:00
Christian Parpart
721bf367a3
[libsolidity] TypeProvider: eliminate redundant "Type" suffix in provider function signatures.
2019-04-17 14:42:07 +02:00
Christian Parpart
862b65d6e3
[libsolidity] remove ReferenceType::copyForLocationIfReference (use TypeProvider instead)
2019-04-17 13:25:03 +02:00
Christian Parpart
b83097bdc6
[libsolidity] Types: eliminate redundant MagicType::metaType() (use TypeProvider instead)
2019-04-17 12:59:48 +02:00
Christian Parpart
58a45f2cb6
[libsolidity] TypeProvider: adds explicit uint256() accessor and removes default params in integerType(...).
2019-04-16 18:28:40 +02:00
Christian Parpart
a2a3b007f3
TypeProvider: storageType() to make all parameters explicit
2019-04-16 18:26:46 +02:00
Christian Parpart
bf43eebea9
libsolidity: Introducing TypeProvider API, for clear type system ownership.
2019-04-16 18:26:45 +02:00
chriseth
2308904f68
Remove "using namespace" from header and move Instruction to dev::eth.
2019-03-28 13:48:11 +01:00
Mathias Baumann
8e899a0d32
Disallow internal function types as parameters for public/external library function
2019-03-21 07:25:57 +01:00
Mathias Baumann
0fbea8a1a0
Change return type for interfaceType() to ResultType
2019-03-21 07:25:28 +01:00
Mathias Baumann
84b68006ba
Fix function calls with named arguments for overloaded functions
2019-03-20 14:54:41 +01:00
Leonardo Alt
9acec99c31
Issue error for callvalue in nonpayable function
2019-03-19 20:45:27 +01:00
Mathias Baumann
4d060ef991
Merge interfaceType() canBeUsedExternally()
...
And cache the result for expensive calls.
2019-03-14 17:19:59 +01:00
Christian Parpart
cfefa2c1d1
Merge pull request #6136 from ethereum/yul-break-continue
...
[Yul] introduce break/continue keywords.
2019-03-11 20:38:57 +01:00
Daniel Kirchner
66fc7ffab2
Allow dynamically encoded calldata structs with ABIEncoderV2.
2019-03-11 16:40:13 +01:00
Christian Parpart
05e2d362c8
[Yul] Adds break/continue statements and some general tests for for-loop syntax.
2019-03-11 15:05:05 +01:00
Daniel Kirchner
f7c6eda2c3
Allow calldata arrays with dynamically encoded base type.
2019-03-06 18:04:12 +01:00
Mathias Baumann
9919670ddd
Check base contracts for abi encoder compatibility
2019-03-06 11:16:54 +01:00
Mathias Baumann
de98e38b78
Prepare code to output errors returned by isImplicitlyConvertibleTo()
2019-03-05 10:44:36 +01:00
chriseth
9a949c1bda
Set default EVM version to Petersburg.
2019-03-04 14:53:00 +01:00
Alex Beregszaszi
ecd246aeb6
Support petersburg in evmVersion
2019-03-04 14:10:41 +01:00
chriseth
ab33ff1408
Merge pull request #6132 from ethereum/ossfuzz-nullref-typechecker
...
TypeChecker: Check if type exists before dereferencing it
2019-02-28 16:38:54 +01:00
Mathias Baumann
50b4193705
TypeChecker: Check if type exists before dereferencing it
2019-02-28 15:49:15 +01:00
Mathias Baumann
f782125463
Fix SMT Checker crash due to missing type information
2019-02-28 11:55:45 +01:00
Mathias Baumann
e4a52aa2f6
Allow dynamic types in public mappings
2019-02-26 15:48:54 +01:00
Alex Beregszaszi
d2f493268b
Provide access to the name of contracts.
2019-02-26 14:07:03 +00:00
Erik Kundt
2d0daae796
Disallows index access on contracts and libraries.
2019-02-25 23:05:33 +00:00
Leonardo Alt
2405b2151a
EVMVersion in langutil namespace instead of solidity
2019-02-25 15:29:57 +01:00
chriseth
7f5b335b47
Make EVM version part of EVM dialect.
2019-02-21 21:59:46 +01:00
Alex Beregszaszi
52496ea719
Proper error message for missing variables in inline assembly
2019-02-20 10:36:55 +00:00
Mathias Baumann
a63f7ca9df
Fix crash due to missing type info
2019-02-19 17:28:44 +01:00
Alex Beregszaszi
2949bd14dd
Merge pull request #6028 from ethereum/warn-about-unused-struct-array-expr
...
Detect custom type expressions that have no effect
2019-02-18 21:12:04 +00:00
Mathias Baumann
e3d4155fa8
Detect custom type expressions that have no effect
2019-02-18 18:59:31 +01:00
Mathias Baumann
093b9ced97
Make sure "value" error hint is only displayed in the right context
...
Before, the hint would be shown for any "value" member, even a user-specified one.
2019-02-18 16:29:57 +01:00
chriseth
db7b38e3c4
Merge pull request #5978 from ethereum/fix-broken-hint
...
Fix error msg hint for non-payable contracts
2019-02-18 11:49:07 +01:00
Daniel Kirchner
809b9a95f9
Even more style checks.
2019-02-14 11:53:00 +01:00
Mathias Baumann
223dac3eca
TypeChecker: Use cast instead of category() check
2019-02-14 11:39:51 +01:00
Mathias Baumann
10a9960eb3
Fix error msg hint for non-payable contracts
2019-02-14 11:39:19 +01:00
chriseth
f003696d7e
Merge pull request #5994 from ethereum/error-to-assert
...
Turn unreachable error into assert
2019-02-13 17:54:01 +01:00
chriseth
1a823f0bf8
Fix tabs/spaces.
2019-02-13 17:05:48 +01:00
Mathias Baumann
a70fee7316
Turn unreachable error into assert
...
The exact conditions are already checked when iterating over the
possibleMembers where the function `canTakeArguments()` is called
for each member. The function does the identical check.
2019-02-13 16:51:05 +01:00
Daniel Kirchner
9e32aa7510
Disallow calldata arrays with dynamically encoded base types in TypeChecker.
2019-02-11 17:13:12 +01:00
chriseth
92cb6cb793
Merge pull request #5936 from ethereum/calldataStructsV2
...
ABIEncoderV2: Implement calldata structs without dynamically encoded members.
2019-02-11 16:18:27 +01:00
Mathias Baumann
259d803387
Conditional Expression: Delay invalid type fatal error
...
Check the whole conditional first and then output errors for
both, the true and false expressions.
2019-02-11 15:47:19 +01:00
Daniel Kirchner
0e4912a203
ABIEncoderV2: Implement calldata structs without dynamically encoded members.
2019-02-11 15:46:58 +01:00
chriseth
b5a2c66771
Merge pull request #5957 from ethereum/function-param-fix
...
Ensure function parameter names always matches parameter types length
2019-02-11 15:45:28 +01:00
Mathias Baumann
66b24225fb
Remove duplicate if-check
2019-02-11 14:56:57 +01:00
Mathias Baumann
fe2429de9f
Packed Encoding: Disallow types in v2 that aren't allowed in v1
2019-02-11 11:37:48 +01:00
chriseth
a8d0ef4bad
Allow indexed structs in events with encoder v2.
2019-02-11 11:37:47 +01:00
Mathias Baumann
57c1c8b46c
Ensure function parameter names always matches parameter types length
2019-02-11 10:57:57 +01:00
Mathias Baumann
5fb79f5e37
Turn unreachable error statements into asserts
2019-02-07 10:07:09 +01:00
Mathias Baumann
9f431339ef
Fix crash for too large struct array indicies
2019-02-06 11:50:25 +01:00
Mathias Baumann
77f407d450
Fix check that mappings can only have storage location
2019-02-05 18:06:42 +01:00
Daniel Kirchner
610ef9f199
Disallow calldata structs.
2019-01-21 10:30:57 +01:00
Alex Beregszaszi
7b759866cb
Merge pull request #5817 from ethereum/refactoring
...
Refactoring in TypeChecker and ContractDefinition
2019-01-18 11:36:49 +00:00
Daniel Kirchner
b7a86a124d
Refactor TypeChecker::visit(FunctionDefinition const&).
2019-01-18 12:12:23 +01:00
Daniel Kirchner
a766efc79f
Add ContractDefinition::isInterface.
2019-01-18 12:11:35 +01:00
chriseth
2ec997e697
Merge pull request #5775 from ethereum/codeAccess
...
Provide access to code of contract types.
2019-01-18 00:16:06 +01:00
chriseth
4669b06ab4
Warn if type(..).runtimeCode is used with assembly in the constructor.
2019-01-17 20:36:48 +01:00
chriseth
0bfdaa500a
Add code access dependency.
2019-01-17 20:36:48 +01:00
chriseth
2fcfb216b5
Syntax for meta type information.
2019-01-17 20:36:48 +01:00
Leonardo Alt
83e7233bb8
Change error message and add tests
2019-01-17 14:28:03 +01:00
Leonardo Alt
c96b760c47
Return TypeError is fixed point encoding is attempted.
2019-01-17 13:36:53 +01:00
Daniel Kirchner
0dfd4a726e
Warn about unreachable code.
2019-01-10 10:36:50 +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
Alex Beregszaszi
c2ec6d71b4
Add version pragma parsing to Parser
2018-12-18 15:02:35 +00:00
Leonardo Alt
36d8a98664
Sort includes in libsolidity/analysis
2018-12-17 12:35:16 +01:00
chriseth
87237281bf
Merge pull request #5630 from ethereum/warn_functions_empty_body
...
Supress unused var and state mut warnings for functions with empty body
2018-12-12 17:00:50 +01:00
Leonardo Alt
508aae8a67
Disable state mutability warning for functions with empty body
2018-12-12 14:43:44 +01:00
Leonardo Alt
53537864a2
Disable unused var warning for functions with empty body
2018-12-12 14:43:44 +01:00
Daniel Kirchner
788612d2ef
Refactoring of the ControlFlowGraph and use for detecting all uninitialized storage accesses.
2018-12-12 04:20:53 +01:00
chriseth
fb3a0ac1c7
Codegen for object access.
2018-12-11 19:24:44 +01:00
chriseth
baaefb4b42
Merge pull request #5619 from ethereum/cleanup-abc
...
Some code cleanup
2018-12-10 19:22:02 +01:00
Mathias Baumann
2f6dc2e773
Replace push_back with emplace_back where it makes sense
2018-12-10 19:02:39 +01:00
Yi Huang
81f703427e
Add tests for implcit conversions from literals to fixed-point numbers.
2018-12-10 17:31:20 +01:00
Erik Kundt
b2afb8cdda
Adds an additional message to failing type conversions.
2018-12-07 11:55:53 +01:00
Erik Kundt
05e74d096e
Introduces Result<T> for operator and implicit conversion type checks.
2018-12-05 10:33:34 +01:00
chriseth
99db4e3ff4
Introduce the concept of builtin functions.
2018-12-04 12:06:33 +01:00
chriseth
3f613a44ec
Merge pull request #5557 from ethereum/fixInterfaceImplementedByPublicStateVariable
...
Public state variables are implementing external functions.
2018-12-03 10:46:44 +01:00
chriseth
0668a9ecfb
Public state variables are implementing external functions.
2018-12-03 10:46:03 +01:00