Commit Graph

5098 Commits

Author SHA1 Message Date
Tyler
519e1c9402 Specify namespaces
Fix references into solidity::util
2022-03-08 00:09:17 -05:00
chriseth
77c40cd2af
Merge pull request #12740 from ethereum/remove-locale-dependent-operations
Replace all locale-dependent operations with locale-agnostic counterparts
2022-03-07 17:56:58 +01:00
wechman
52dfccca98 Replace all locale-dependent operations with locale-agnostic counterparts 2022-03-07 17:23:08 +01:00
chriseth
57e012da98
Merge pull request #12663 from ethereum/assemblyAnnotationDialectString
Assembly annotation as memory-safe using assembly flags.
2022-03-07 13:03:08 +01:00
chriseth
4f19d68ee9
Merge pull request #12620 from ethereum/assemblyAnnotation
Memory-safety annotation for inline assembly.
2022-03-07 12:48:41 +01:00
Tyler
a890c82f9d Remove use of using namespace in header file 2022-03-06 23:16:10 -05:00
nishant-sachdeva
beabc51c20 returnSize assigned according to truth value of returnInfo.dynamicReturnSize 2022-03-03 18:55:10 +05:30
Daniel Kirchner
290b1c3a90 Allow memory-safe inline assembly dialect flag. 2022-03-02 17:07:11 +01:00
Daniel Kirchner
9bcfcc61a7 Inline assembly without memory effects is implicitly memory safe. 2022-03-02 16:42:28 +01:00
Daniel Kirchner
e6848caac1 Allow annotating inline assembly as memory-safe. 2022-03-02 16:42:28 +01:00
chriseth
b0dcd7b915 Split out disassemble to remove numeric from instruction includes. 2022-03-02 15:30:41 +01:00
chriseth
ebd584fcfb
Merge pull request #12206 from ethereum/extractExternalFunctionPart
Extract external function part
2022-02-28 13:04:14 +01:00
Kamil Śliwak
8962d53e3c
Merge pull request #12701 from a3d4/fix-running-tests-from-any-drive
Fix running path-related tests from any Windows drive
2022-02-28 12:58:45 +01:00
chriseth
ca4c983973
Merge pull request #12695 from ethereum/less-confusing-err
Make error message less confusing
2022-02-28 12:36:47 +01:00
a3d4
50ae21d1bf Fix running tests from any drive 2022-02-22 18:11:42 +01:00
nishant-sachdeva
195f72e844 Added errorSelector field for custom errors 2022-02-21 19:14:33 +05:30
chriseth
106921c278 Extract external function part into its own function. 2022-02-21 14:32:52 +01:00
Marenz
175580fe90 Make error message less confusing 2022-02-17 16:52:36 +01:00
Daniel Kirchner
c47da51eab Consider all grandparents in override analysis. 2022-02-14 15:31:31 +01:00
nishant-sachdeva
276851ff91 Added support for FunctionType::Kind::StringConcat and functions string.concat 2022-02-10 22:08:47 +05:30
Marenz
46075d04d9 Include used events in `--hashes` output 2022-02-09 13:50:42 +01:00
Marenz
3e7c68d9b0 Merge identifier query methods into one 2022-02-08 17:44:21 +01:00
joshieDo
9e62f21b25 Add event and error identifiers to cli hashes cmd 2022-02-08 17:44:21 +01:00
chriseth
5c3bcb6c2d
Merge pull request #12434 from ethereum/outputLocations
Output searched locations on import failure.
2022-02-08 17:16:46 +01:00
joshuatarkwski
6225dad332 Output searched locations on import failure. 2022-02-08 16:20:27 +01:00
Kamil Śliwak
28bc5db576
Merge pull request #12598 from a3d4/case-insensitive-root-in-normalizeclipathforvfs
Treat root path in normalizeCLIPathForVFS as case insensitive on Windows
2022-02-08 13:17:05 +01:00
Mathias L. Baumann
c139d39b9b
Merge pull request #12589 from ethereum/emit-immutable-references
Emit immutable references for pure yul code
2022-02-07 13:21:44 +01:00
Marenz
b9fe628b70 Emit immutable references for pure yul code 2022-02-07 12:32:54 +01:00
a3d4
0a17495cf9 Treat root path in normalizeCLIPathForVFS as case insensitive on Windows 2022-02-05 11:51:11 +01:00
nishant-sachdeva
e85bceb417 Types.h:872 had a comment /// String is interpreted as a subtype of
Bytes. - this was now incorrect after #12593 . That has been removed
now.
2022-02-04 15:49:08 +05:30
nishant-sachdeva
cc6344c03c Changed instaces of isByteArrayOrString() to isByteArray() where it's only supposed to return a True for Bytes Type 2022-02-02 17:05:26 +05:30
nishant-sachdeva
9043621747 Changed occurences of isByteArray() to isByteArrayOrString(). The idea
is to, in a future commit, replace such occurences of
isByteArrayOrString() which are required to return True only for Bytes
type with a new isByteArray() function.
2022-02-02 14:19:58 +05:30
nishant-sachdeva
e2711b7fab Corresponding code in the .cpp file has been commented instead of begin removed pending preliminary reviews
Code generators needed fixing of the cleanup process during typecasting of bytes and integers
2022-02-01 16:07:55 +05:30
hrkrshnn
0fe5811459 Fixed a ICE on calldata to struct member copy 2022-01-31 17:26:11 +01:00
nishant-sachdeva
dec511aad8 Corresponding code in the .cpp file has been commented instead of begin removed pending preliminary reviews
Code generators needed fixing of the cleanup process during typecasting of bytes and integers
2022-01-28 19:56:15 +05:30
Mathias L. Baumann
b6dbfdf79b
Merge pull request #12494 from ethereum/AST-ImportDirective-traversal-fix
Adds missing accepts to ImportDirective's SymbolAlias::symbol.
2022-01-24 13:27:00 +01:00
Marenz
6f4709d383 Remove empty assert messages 2022-01-20 15:11:26 +01:00
Marenz
a550048cf0 Fix too strict assert for calldata string -> bytes conversions 2022-01-20 15:11:26 +01:00
nishant-sachdeva
27d0480e96 Adding Stack Height Checker and modifying the number of POP instructions to appropriately provide the pointer address 2022-01-20 01:15:08 +05:30
Daniel Kirchner
92c262d116
Merge pull request #12553 from ethereum/ir-ice-12546
Fix .push() not considering external functions
2022-01-19 13:41:20 +01:00
nishant-sachdeva
a0d6c11860 Equality operator allowed for external function types 2022-01-19 15:20:31 +05:30
Marenz
89d6bff72a Fix .push() not considering external functions 2022-01-18 16:30:31 +01:00
Marenz
7c0a121e45 Natspec: Fix ICE when overriding a struct getter with a Natspec-documented return value and the name in the struct is different. 2022-01-17 17:10:07 +01:00
Marenz
0004ad8764 Fix ICE when a constant variable declaration forward references a struct 2022-01-17 13:24:14 +01:00
Marenz
2c4c8264e4 Fix wrong error with immutables when base contract c'tor uses return 2022-01-13 13:09:36 +01:00
Christian Parpart
f5ff358add Adds missing accepts to ImportDirective's SymbolAlias::symbol 2022-01-10 19:32:28 +01:00
Mathias L. Baumann
63b6bbe15c
Merge pull request #12471 from ethereum/modifiers-control-flow-11483
Properly generated control flows for inherited modifiers
2022-01-06 13:39:50 +01:00
Marenz
e969aed780 Properly resolve virtual modifiers 2022-01-06 12:52:06 +01:00
Christian Parpart
1bd0f9570f LSP: Introduces lspAssert(condition, ErrorCode, message) 2022-01-05 11:30:04 +01:00
chriseth
c16867cb83
Merge pull request #12272 from ethereum/equalStoreEliminator
Equal store eliminator.
2022-01-05 11:24:59 +01:00
Christian Parpart
4105b0a587 LSP: Introduce HandlerError(id, code, message) exception for easier handling. 2022-01-05 11:04:40 +01:00
chriseth
e3bb5ab7b2
Merge pull request #12431 from ethereum/fixFun2
Safer constructors for FunctionType
2022-01-04 18:18:21 +01:00
chriseth
772e100813 Equal store eliminator. 2022-01-03 15:52:05 +01:00
chriseth
692614df72
Merge pull request #12437 from ethereum/encodeCallForDeclarations
abi.encodeCall for declarations.
2021-12-29 18:40:18 +01:00
Leo
048a8f4d28
Merge pull request #12455 from ethereum/smt_analyze_contracts
[SMTChecker] Do not analyze unecessary contracts
2021-12-29 15:14:35 +01:00
Marenz
b95db2db5e Remove unnecessary checks in modifier resolve function 2021-12-29 13:27:10 +01:00
chriseth
4c838d9cf5 abi.encodeCall for declarations. 2021-12-29 12:26:04 +01:00
Leo Alt
fb8c138b8b Do not analyze unecessary contracts 2021-12-24 19:36:32 +01:00
chriseth
7620bfaad8 Add option member for function type. 2021-12-23 12:05:18 +01:00
chriseth
f94279a437 Use options struct for function type factory function. 2021-12-23 12:05:14 +01:00
chriseth
4fa8eee683 Use function names instead of members. 2021-12-23 11:55:33 +01:00
chriseth
ef6dd2ec50
Merge pull request #12433 from ethereum/removeConstexpr
Remove constexpr.
2021-12-21 16:03:58 +01:00
mejsiej
ddd9a84141 Improve failure message when generating getter. 2021-12-20 18:16:27 +01:00
chriseth
c374d27eec Remove constexpr. 2021-12-20 17:30:20 +01:00
chriseth
3193dfbb5d
Merge pull request #11350 from ethereum/lsp
Language Server
2021-12-16 18:54:26 +01:00
Christian Parpart
927b24df1f Initial implementation of Language Server 2021-12-16 17:52:49 +01:00
Marenz
7a96953e78 Implement typechecked abi.encodeCall() 2021-12-16 17:35:58 +01:00
nishant-sachdeva
9b55d4788e Added sameType check for fromType and toType in YulUtilFunctions.cpp and relevant tests in semanticTests 2021-12-15 23:50:25 +05:30
Leo Alt
316be7206f Fix soundness of storage/memory pointers that were not erasing enough knowledge 2021-12-14 12:02:18 +01:00
chriseth
c0b41cfcdd Add const and file name. 2021-12-13 17:33:48 +01:00
chriseth
0e6388a907 Clarify FileReader interface. 2021-12-13 14:54:58 +01:00
nishant-sachdeva
a4fbc607c6 Issue 11610 : Replced typeError with fataTypeError in lines 390 and 406. Test file added in test/libsolidity/syntaxTests/calldata_struct_argument_with_internal_type_inside.sol
Issue : 11610 : Test cases updated, Changelog.md file updated to include change on 0.8.11
2021-12-03 12:23:35 +05:30
Leo Alt
16535aae32 Fix ICE when unsafe targets are solved more than once and the cex is different 2021-12-03 00:21:38 +01:00
chriseth
b6bd85202c Accessors for exceptions. 2021-12-01 14:26:23 +01:00
chriseth
1633e367c9
Merge pull request #12199 from ethereum/expose-parsingAndImporting
Expose "parsingAndImporting" setting to user
2021-11-08 17:06:20 +01:00
Marenz
fc224f74c7 Evaluate absolute paths for imports in 'parsing' stage 2021-11-08 16:34:02 +01:00
chriseth
a1aa9d2d90 Skip extcodesize check if return data is expected. 2021-11-08 14:58:09 +01:00
chriseth
f9ba1bf3c8
Merge pull request #12227 from ethereum/smt_fix_gas
Fix ICE in CHC when using gas in the function options
2021-11-08 11:54:20 +01:00
Leo
58688bd9c1
Merge pull request #12167 from ethereum/smt_merge_query_entry_points
[SMTChecker] Merge all entry points for a target
2021-11-03 16:43:16 +01:00
Leo Alt
dff280cadc Fix ICE in CHC when using gas in the function options 2021-11-03 15:40:54 +01:00
Daniel Kirchner
4229369180 Compatibility with StackCompressor and StackLimitEvader. 2021-11-03 12:39:55 +01:00
Leo Alt
e40cf92b1d [SMTChecker] Merge all entry points for a target 2021-11-03 11:12:58 +01:00
chriseth
8e208f23cb Fix assignment of return variables from modifiers. 2021-11-01 14:14:50 +01:00
David Dzhalaev
79ffa16a61 Improve error message for contract size limit error 2021-10-27 20:06:53 +02:00
hrkrshnn
8815d6f5f0 Moved a check related to constants to TypeChecker
And added a proper error message when constant types containing (nested) mapping types are used.
2021-10-26 18:43:04 +02:00
hrkrshnn
51009c005d Moved a canBeStored assert for struct members to TypeChecker
This is to avoid a assert from failing for forward declared user defined value types.
2021-10-26 18:43:04 +02:00
hrkrshnn
9428dbc94f Moved storage size assert to TypeChecker from DeclarationTypeChecker 2021-10-26 18:43:04 +02:00
Leo Alt
37215ffcfd Add SMTCheckerTest isoltest option to ignore invariants 2021-10-26 11:30:30 +02:00
Leo Alt
3118fb3666 Add invariants option to CLI and JSON 2021-10-26 11:30:30 +02:00
Leo Alt
d419c30ca6 Add errorCode list to invariants report 2021-10-26 11:30:30 +02:00
Leo Alt
49e7627bd3 Use invariants in CHC 2021-10-26 11:30:30 +02:00
Leo Alt
bc90533c93 Add invariants to ModelCheckerSettings 2021-10-26 11:30:30 +02:00
Leo Alt
d554824f70 Add Invariants which traverses the proof and collects invariants for the given predicates 2021-10-26 11:30:30 +02:00
Leo Alt
9bcd2c18e4 Add expression substitution to Predicate 2021-10-26 11:30:30 +02:00
Leo Alt
ce72d7cd26 Add ExpressionFormatter which translates an smtutil::Expression into a Solidity-like expression string 2021-10-26 11:30:30 +02:00
Kamil Śliwak
fdf3b96e3f
Merge pull request #12155 from vowchick/develop
Use range-v3 loops: delete boost includes
2021-10-16 12:03:43 +02:00
vowchick
5d985a24ac Use range-v3 loops: delete boost includes
An addition to issue #10738, couldn't change boost::for_each to
std::for_each, doesn't compile.

Build successful
./scripts/test.sh successful
2021-10-16 11:54:46 +03:00
tcoyvwac
ba0c09e082
Prefer make_unique over new 2021-10-15 19:46:47 +02:00
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