Commit Graph

5100 Commits

Author SHA1 Message Date
chriseth
1e630fc584
Merge pull request #12082 from ethereum/controlFlowSideEffectsUserDefined
Control flow side effects of user defined functions
2021-10-14 18:28:22 +02:00
chriseth
9417d6775f Control flow side-effects for user-defined functions. 2021-10-14 17:46:07 +02:00
Christian Parpart
86a7e19879 libsolidity: Adding a comment to nameLocation(). 2021-10-14 17:33:15 +02:00
chriseth
1a931a5108 Make use of inner loops. 2021-10-13 15:56:23 +02:00
chriseth
49d7b78466
Merge pull request #12123 from ethereum/empty-switch-12068
CodeGen: Only output switch when it has cases
2021-10-12 17:42:49 +02:00
Mathias Baumann
454860d1f5 CodeGen: Only output switch when it has cases 2021-10-12 17:40:31 +02:00
chriseth
adc58c67b4
Merge pull request #11944 from ethereum/debug-info-selection
Debug info selection
2021-10-12 16:39:50 +02:00
Kamil Śliwak
e136788493 Replace BOOST_THROW_EXCEPTION() with solThrow() where appropriate 2021-10-11 20:35:00 +02:00
Kamil Śliwak
a9e794c872 Expose --debug-info/settings.debug.debugInfo option 2021-10-11 20:34:48 +02:00
Kamil Śliwak
bcfefc79d9 Pass DebugInfoSelection down to the code handling assembly printing 2021-10-11 20:34:48 +02:00
Kamil Śliwak
f7c4ed849d Handle DebugInfoSelection in the code printing Yul and EVM assembly 2021-10-11 20:34:48 +02:00
Christian Parpart
3f08b2269a Adds fmtlib as 3rdparty dependency for easier string composition. 2021-10-11 13:35:08 +02:00
Kamil Śliwak
a30348715b Use boost::current_exception_diagnostic_information() to print extra info about exceptions caught by (...) 2021-10-07 17:41:25 +02:00
Marenz
4368da0201 Fix ICE when printing an error message related to mappings 2021-10-06 17:02:36 +02:00
Leo Alt
4c2b661eaa [SMTChecker] Report values for block, msg and tx variables in counterexamples 2021-10-05 15:19:10 +02:00
chriseth
ecfcca1a27
Merge pull request #12016 from ethereum/external-fp-10358
Add ``.address`` and ``.selector`` in inside assembly for external function pointers
2021-10-05 14:48:58 +02:00
Marenz
98dd78362e Add `.address and .selector` in inside assembly for external function pointers 2021-10-04 18:05:57 +02:00
Kamil Śliwak
7f7107405f Try out the new assertion macro variants with less arguments 2021-10-04 12:05:00 +02:00
Leo Alt
d81ebe97c3 Fix magic access 2021-10-01 12:57:06 +02:00
chriseth
df9721f869
Merge pull request #12047 from ethereum/fixFixedBytesCompilerUtils
Properly handle fixed-byte-like types.
2021-09-29 12:23:15 +02:00
chriseth
13354c0b9a
Merge pull request #12050 from ethereum/signedImmutablesBug
Fix signed immutables bug.
2021-09-29 11:46:58 +02:00
chriseth
77932edb02 Consider non-external functions not left-aligned. 2021-09-29 11:44:17 +02:00
chriseth
cb052611cf Fix signextend for user defined value types. 2021-09-29 11:44:17 +02:00
chriseth
da5c5928fe Properly handle fixed-byte-like types. 2021-09-29 11:41:47 +02:00
hrkrshnn
6109b5c3a1 UserDefinedValueType.storageBytes() is correctly set
Previously it returned 32 bytes for all types, which was wasteful. This commit changes it to return
the storage bytes of the underlying type.
2021-09-29 11:41:47 +02:00
chriseth
8f7ba99e30
Merge pull request #12045 from ethereum/arrayTestsForUDFT
Fix array copying check.
2021-09-29 10:39:34 +02:00
chriseth
90f4ca1048 Do not store immutables packed. 2021-09-29 10:12:05 +02:00
chriseth
bb4e3e191d Fix array copying check. 2021-09-29 10:00:14 +02:00
chriseth
b6e62d61ec Export canonicalName 2021-09-28 12:00:30 +02:00
Kamil Śliwak
f909555022 Treat ambiguous imports as errors 2021-09-27 13:14:23 +02:00
Kamil Śliwak
9975b5e26b Detect source unit name collisions between paths specified on the command line 2021-09-27 13:14:23 +02:00
Kamil Śliwak
c8a7a1da7c Add --include-path option 2021-09-27 13:14:23 +02:00
Kamil Śliwak
479ba7c523 Handle allowing empty paths correctly 2021-09-27 13:14:10 +02:00
Kamil Śliwak
3ac3612767 Whitelist base path 2021-09-27 13:14:10 +02:00
Kamil Śliwak
52dd39212d Normalize allowed paths before comparing them with imports 2021-09-27 13:14:10 +02:00
Kamil Śliwak
a436abfb25 normalizeCLIPathForVFS(): Add an option for resolving symlinks 2021-09-27 13:14:10 +02:00
Kamil Śliwak
f0dceffe1d Refactor parsing of remappings to remove duplication and improve readability 2021-09-27 13:14:10 +02:00
Kamil Śliwak
d06dc7613e Print diagnostic info for more exception types in the default import callback 2021-09-27 13:14:10 +02:00
Alex Beregszaszi
3c8846e669
Merge pull request #11976 from ethereum/json-cleanup
Some cleanup and testing for JSON
2021-09-24 19:03:45 +01:00
chriseth
1531863835 Split Common.h into Numeric.h. 2021-09-23 15:27:29 +02:00
chriseth
c8e6ef9657
Merge pull request #12004 from ethereum/disambiguateBytesRequired
Disambiguate bytesRequired
2021-09-23 15:25:44 +02:00
chriseth
5a3a5c746f
Merge pull request #11864 from ethereum/protectViaIR
Add protection against mixing "viaIR" and "non-viaIR".
2021-09-22 16:16:11 +02:00
Harikrishnan Mulackal
55d609d354
Merge pull request #11990 from ethereum/smt_user_types
[SMTChecker] Support user types
2021-09-22 15:40:49 +02:00
chriseth
9f8406ad37 Add protection against mixing "viaIR" and "non-viaIR". 2021-09-22 15:34:39 +02:00
Kamil Śliwak
fc7e8c56dc Fill out originLocation with nativeLocation when importing Yul AST 2021-09-22 13:17:18 +02:00
Kamil Śliwak
ce4420f857 Separate DebugData fields for Solidity and Yul source locations 2021-09-22 13:11:39 +02:00
chriseth
50ce1f5ddd Disambiguate bytesRequired 2021-09-22 11:22:07 +02:00
chriseth
7637286074 Remove unused function. 2021-09-22 11:11:51 +02:00
chriseth
2741175507 Use function debug data. 2021-09-22 11:11:51 +02:00
Marenz
7a51acc5fe Correct wrong error message referencing .slot and .offset when .length was used 2021-09-21 18:28:38 +02:00
Leo Alt
e74f853c6b [SMTChecker] Support user types 2021-09-21 13:23:17 +02:00
Alex Beregszaszi
55c64e3ca1 Always explicitly initialise Json objects 2021-09-21 10:49:13 +01:00
Kamil Śliwak
fc8c4b046c StandardCompiler: Do not discard non-fatal errors that happened before a fatal error 2021-09-16 20:29:03 +02:00
chriseth
3f8023ace9
Merge pull request #11981 from ethereum/simplifyVersion
Simplify version.cpp
2021-09-16 18:28:19 +02:00
chriseth
8b3748e5b7 Emit ast id. 2021-09-16 17:19:17 +02:00
chriseth
a72f4f3993 Print AST ID. 2021-09-16 17:19:17 +02:00
chriseth
c892d1904b Simplify version.cpp 2021-09-16 16:03:27 +02:00
Leo Alt
a1bea368cb [SMTChecker] Support constants via modules 2021-09-16 14:35:05 +02:00
chriseth
4284499180
Merge pull request #11888 from ethereum/spdx-license-handling-10145
Properly detect multiple licenses and validate them.
2021-09-16 14:18:17 +02:00
chriseth
ff0e433635
Merge pull request #11965 from ethereum/userdefined-changed-toString
User defined value types changed toString()
2021-09-16 13:58:55 +02:00
Marenz
c81814915c Properly detect multiple licenses and validate them. 2021-09-16 11:18:26 +02:00
Alex Beregszaszi
c1070fabc0
Merge pull request #11906 from ethereum/smt_fix_bmc
[SMTChecker] Fix BMCs constraints on internal functions
2021-09-15 21:01:29 +01:00
hrkrshnn
48e16ceb88 Changing the UserDefinedValueType::toString to userdefined <name> 2021-09-15 17:25:23 +02:00
chriseth
34e516ea1b
Merge pull request #11963 from ethereum/slightABIDecodeImprovement
Improve abi decoding functions for arrays.
2021-09-15 15:42:13 +02:00
Leo Alt
b731957e65 Fix BMCs constraints on internal functions 2021-09-15 14:42:39 +02:00
Daniel Kirchner
d1c0b428fc Improve abi decoding functions for arrays. 2021-09-15 13:50:19 +02:00
hrkrshnn
de01822999 UserDefinedValueType: from simple name to canonical name. 2021-09-15 12:56:29 +02:00
Daniel Kirchner
0fa24c786b
Merge pull request #11956 from ethereum/userDefinedTypesContractAccess
Allow accessing user defined value type members via contract name.
2021-09-14 17:14:04 +02:00
Daniel Kirchner
be29ef70a7 Allow accessing user defined value type members via contract name. 2021-09-14 16:24:14 +02:00
chriseth
8735d3fb6c
Merge pull request #11930 from ethereum/calldataStructInlineAssembly
Fix inline assembly assignments to calldata structs and statically-sized calldata arrays.
2021-09-14 16:16:48 +02:00
chriseth
8188ea7d66
Merge pull request #11931 from ethereum/different-metadata-via-ir
Different metadata for IR
2021-09-14 15:48:08 +02:00
Leonardo
e45083f319
Merge pull request #11606 from ethereum/info_message
Add new info severity
2021-09-14 14:30:07 +02:00
Kamil Śliwak
405a9e9971 Generate separate metadata for the old and the new codegen 2021-09-14 13:44:04 +02:00
Kamil Śliwak
14639efc5d Print code snippets next to source locations in IR output 2021-09-14 12:09:59 +02:00
Kamil Śliwak
37f681c430 Deduplicate code for printing source locations 2021-09-14 11:46:57 +02:00
Leo Alt
e72fa7fc10 Add new info severity 2021-09-13 22:48:22 +02:00
Daniel Kirchner
fc37b18e88 Fix inline assembly assignments to calldata structs and statically-sized arrays. 2021-09-13 15:22:46 +02:00
Harikrishnan Mulackal
8fafdeacac
Merge pull request #11939 from ethereum/userdefined-types-mapping-key
Allow Mapping keys to have type UserDefinedValueType.
2021-09-13 15:06:14 +02:00
hrkrshnn
a1d4d0125d Allow UserDefinedValueType.uwrap (and wrap) as RHS of constant decl
Needed to make `MyType.unwrap` and `MyType.unwrap` as pure in the process. This change affected some
existing tests ("statement has no effect").
2021-09-13 11:53:05 +02:00
hrkrshnn
1fa6c71bd0 Allow Mapping keys to have type UserDefinedValueType.
Also added syntax and semantic test.
2021-09-13 10:03:49 +02:00
Harikrishnan Mulackal
8a37f56e98
Merge pull request #11806 from ethereum/user-defined-types
User defined value types
2021-09-09 10:28:35 +02:00
hrkrshnn
d67391531e Implemented ASTJson import export for UserDefinedValueType
Also added a test.
2021-09-08 21:19:30 +02:00
hrkrshnn
54484e9795 Implemented codegen for UserDefinedValueType 2021-09-08 19:56:48 +02:00
chriseth
0b5671c885 Clarify C++ evaluation order. 2021-09-08 12:25:56 +02:00
chriseth
c63b768fff Sort yul functions by creation time. 2021-09-08 12:25:56 +02:00
hrkrshnn
ce75790e8d TypeChecker: added checks for wrap and unwrap
For user defined value types and also added a test case.
2021-09-07 19:42:51 +02:00
hrkrshnn
0647039864 DeclarationTypeChecker for UserDefinedValueTypes
- Checks for repetitions.
- Assigns types.
- Checks if the 'actual type' is an elementary type name.
- Checks if the 'actual type' is a value type.

Also added tests.
2021-09-07 19:42:51 +02:00
hrkrshnn
15452371d4 Types for UserDefinedValueType 2021-09-07 19:42:51 +02:00
hrkrshnn
9f7426b4a9 Implemented parsing for UserDefinedValueType
Also added parsing tests.
2021-09-07 19:42:51 +02:00
hrkrshnn
d3ae9cf71b Added AST node UserDefinedValueType 2021-09-07 19:42:51 +02:00
Leo Alt
6e2fe1e340 [SMTChecker] Cleanup spurious messages about TypeTypes 2021-09-07 16:55:25 +02:00
chriseth
5093cff7ae Rename source location function. 2021-09-06 18:33:36 +02:00
chriseth
f14b7598c7 Only list used source names. 2021-09-06 18:33:05 +02:00
chriseth
5d2931cba3 Refactor: Add helper for context. 2021-09-06 18:18:33 +02:00
Daniel Kirchner
8447b32d52
Merge pull request #11861 from ethereum/smt_value
[SMTChecker] Support `value` in CHC for external function calls
2021-09-03 14:00:21 +02:00
chriseth
7f137d352a
Merge pull request #11869 from ethereum/remodelUseSrc
Allow and require use-src to be repeated for each object.
2021-09-02 18:34:07 +02:00
chriseth
9c2ab1ff2f
Merge pull request #11881 from ethereum/unsuable-symbol-11855
Properly export symbols from aliased imports.
2021-09-02 16:39:16 +02:00
chriseth
5caa15879b Allow and require use-src to be repeated for each object. 2021-09-02 11:29:42 +02:00
Leo Alt
106c591dde Support the external call option 2021-09-01 20:18:37 +02:00
Marenz
4700c2b973 Properly export symbols from aliased imports. 2021-09-01 19:55:30 +02:00
Marenz
2b28f87abf Add type().min/max for enums 2021-09-01 15:02:02 +02:00
Harikrishnan Mulackal
1e334a8993
Merge pull request #11799 from benldrmn/increase_use_of_constexpr
Increase use of C++ constexpr
2021-08-31 17:23:36 +02:00
Kamil Śliwak
d07b796675 Disallow modifier declarations and definitions in interfaces 2021-08-31 15:25:08 +02:00
benldrmn
58e4cc62e0 Increase use of C++ constexpr constant expressions in code base as described in issue #7720 2021-08-31 15:03:59 +02:00
chriseth
f7916f2940 Add override exception for interface functions. 2021-08-31 10:45:31 +02:00
Leo Alt
ac528cfd1b add static array length constraint 2021-08-30 17:15:16 +02:00
Leo Alt
16bc15acac Fix false negative on storage array references returned by internal functions 2021-08-28 09:30:53 +02:00
Leo Alt
60b866f9d8 Fix ICE on multi-source use of abi.* 2021-08-27 18:55:36 +02:00
Leo Alt
8e81df1bd3 Do not show redundant unsupported errors in SMTChecker 2021-08-27 16:25:09 +02:00
Kamil Śliwak
13f46ebb1e FileReader: Normalize base path and strip it from normalized source paths 2021-08-27 15:10:46 +02:00
Leonardo
6e6bbb2f83
Merge pull request #11837 from soroosh-sdi/use-range-v3-part2
Using range-v3 instead of boost
2021-08-26 09:38:27 +02:00
Leo Alt
61160aa0e7 Add constraints correlating address(this).balance and msg.value 2021-08-25 21:10:08 +02:00
Leo Alt
718f392849 Don't erase things for BMC if function call is staticcall 2021-08-25 14:09:46 +02:00
Leo Alt
a55685c04f Erase balances when delegatecall is seen 2021-08-25 12:39:26 +02:00
soroosh-sdi
b0ce98bcb2 Using range-v3 instead of boost
Signed-off-by: soroosh-sdi <soroosh.sardari@gmail.com>
2021-08-24 23:50:23 +04:30
soroosh-sdi
0417ee2a21 Replace boost::adaptors with range-v3
Signed-off-by: soroosh-sdi <soroosh.sardari@gmail.com>
2021-08-24 13:07:26 +04:30
Kamil Śliwak
6b7857d56b
Merge pull request #11650 from ethereum/boost-path-in-read-file-as-string
Use `boost::filesystem::path` in `readFileAsString()`
2021-08-20 19:45:54 +02:00
Leo Alt
d89d63bf9c Use the nondeterministic interface also for BARECALL 2021-08-19 16:34:01 +02:00
Marenz
121fd40f74 Allow reading of immutables during construction time 2021-08-19 13:59:05 +02:00
Kamil Śliwak
cb1a0f08ca readFileAsString(): Accept path as boost::filesystem::path instead of string 2021-08-17 12:58:33 +02:00
chriseth
94c4e1e172 Simplify yul conversion function even more. 2021-08-16 22:24:06 +02:00
chriseth
fe0d027d45
Merge pull request #11785 from ethereum/someMoreBaseFees
Some more base fees.
2021-08-12 19:48:10 +02:00
Leo Alt
6ee60aa628 Fix false positive on external calls from constructors 2021-08-12 18:51:55 +02:00
chriseth
90c4623460 Some more base fees. 2021-08-12 16:37:21 +02:00
chriseth
ccdc11ea5b
Merge pull request #11741 from ethereum/shadowing_inlineasm_fix_yul_codegen
Fixed inline assembly external identifier access.
2021-08-12 14:38:24 +02:00
Leo Alt
10397e440c Fix ICE in constants 2021-08-12 10:53:01 +02:00
chriseth
a4c94a1b5b Fixed inline assembly external identifier access. 2021-08-11 18:18:29 +02:00
hrkrshnn
95091f6b58 Implemented block.basefee in Solidilty and basefee() in Yul.
Also added basefee to Yul grammar.
2021-08-09 16:18:08 +02:00
Leo Alt
ee6285d6d7 Do not create VCs for underoverflow by default for Sol >=0.8 2021-08-09 14:12:31 +02:00
Leo Alt
08c065ee04 Add option divModWithSlacks 2021-08-06 15:50:25 +02:00
chriseth
db85849648
Merge pull request #11737 from ethereum/fix_shift_cleanup
Yul: Fix cleanup for left shift of bytes types.
2021-08-05 12:55:42 +02:00
chriseth
6b888b531b Refactor conversion function. 2021-08-05 11:48:35 +02:00
chriseth
0112fed73b Yul: Fix cleanup for left shift of bytes types. 2021-08-05 10:54:48 +02:00
chriseth
467cbf92bc Only provide code generator to CodeTransform. 2021-08-04 18:38:10 +02:00
Leo Alt
3c1f555f71 Tests 2021-08-04 13:54:50 +02:00
Leo Alt
41087f3195 Add CLI and JSON option to show unproved targets 2021-08-04 13:54:50 +02:00
Leo Alt
685d7a8c99 Bundle all unproved targets in a single message and only show all if setting chooses that 2021-08-04 13:54:50 +02:00
chriseth
ae519c1278
Merge pull request #11658 from ethereum/removeScannerFromCompilerStack
Remove scanner from compiler stack
2021-08-03 17:47:39 +02:00
Christian Parpart
d203c80abd Eliminate unnecessary m_source from Parser 2021-08-03 16:03:45 +02:00
Christian Parpart
6294aa871a Simplify AsmParser::parse(.) usage 2021-08-03 15:43:17 +02:00
chriseth
ffc5cfd9a5 Remove scanner from compiler stack. 2021-08-03 15:43:17 +02:00
Mathias Baumann
2ee6c7be64 Print @src and @use-src locations in AsmPrinter 2021-08-03 15:29:52 +02:00
Leo Alt
6c8ecfa82c Add option to choose solver 2021-07-27 17:14:21 +02:00
Ladislav Sladecek
9bbeea58c8 Make --pretty-json work with Standard JSON output 2021-07-26 16:00:46 +02:00
Kamil Śliwak
6d6c9e6e4f
Merge pull request #11660 from ethereum/docs-fix-badly-indented-lists-and-blocks
[Docs] Fix badly indented lists and blocks
2021-07-21 18:35:19 +02:00
Mathias Baumann
bf204403d8 Add "@use-src" header for generated yul code 2021-07-15 14:26:01 +02:00
Marenz
57db4c82ba Fix: Use correct byte offset separation
":" instead of ","
2021-07-15 13:15:21 +02:00
Kamil Śliwak
ce79e2515b docs: Fix badly indented lists 2021-07-15 10:13:30 +02:00
Kamil Śliwak
6753c8f624 Rename escapeAndQuoteYulString() back to escapeAndQuoteString() 2021-07-14 21:29:01 +02:00
chriseth
e3525b81d0 Supply scanner to model checker. 2021-07-14 15:12:10 +02:00
chriseth
01dc77e5a2 Properly assign source names for AST import. 2021-07-14 15:12:10 +02:00
chriseth
f75b55071e Remove CharStream from SourceLocation. 2021-07-14 15:12:07 +02:00
Christian Parpart
132fa46faa Yul: Adds parsing @src comment in AsmParser to customize the AST's sourcer locations. 2021-07-09 11:48:00 +02:00
Daniel Kirchner
0a6fc89da2 Fix negation function name collision. 2021-07-08 10:47:29 +02:00
chriseth
566537835b
Merge pull request #11627 from ethereum/allowEmptyFileName
Include locations with empty source name.
2021-07-07 12:52:49 +02:00
chriseth
6ba298c82b Include locations with empty source name. 2021-07-07 12:13:52 +02:00
Kamil Śliwak
7d16c7b127 Equality operators for ModelCheckerSettings and ImportRemapper 2021-07-06 17:17:18 +02:00
chriseth
09578e7e22
Merge pull request #11550 from ethereum/runs-constant
Constant for default --runs
2021-07-06 10:44:07 +02:00
chriseth
54b1c667f1
Merge pull request #11595 from ethereum/issue-11526
Fix yul codegen bug when using binary negation.
2021-06-30 11:55:42 +02:00
Mathias Baumann
c47d02066c Fix yul codegen bug when using binary negatition. 2021-06-29 17:41:03 +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
1d1d74bd0e RationalNumberType: Fix wrong docstring about m_compatibleBytesType being used for explicit conversions 2021-06-29 13:27:21 +02:00
Kamil Śliwak
19fada966f Do not use \b, \v and \f escapes in string literals in generated Yul code 2021-06-28 14:13:47 +02:00
Kamil Śliwak
6ad6fa2382 Do not hard-code the default 'runs' value as 200 in code that fills out optimizer settings 2021-06-28 14:12:28 +02:00
Kamil Śliwak
6d8ef71277 Consistently use size_t everywhere for runs/expectedExecutionsPerDeployment 2021-06-28 14:09:28 +02:00
Kamil Śliwak
ca0b1bf3f3 Fix crash when passing zero to bytes.concat() 2021-06-25 21:26:28 +02:00
Alexander Arlt
8accf420ea [yul] Functions: Remove dependency on AST ID. 2021-06-23 16:15:25 +02:00
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