Commit Graph

3048 Commits

Author SHA1 Message Date
mingchuan
f1374066af
Add shortcuts for formatting error information 2019-04-10 18:44:45 +08:00
Mathias Baumann
b4380a2137 Move convert functions to Yul module 2019-04-09 15:31:46 +02:00
Leonardo Alt
4fe303530a [SMTChecker] Show unsupported warning for asm blocks 2019-04-05 16:41:15 +02:00
Leonardo Alt
79d8a4e13a [SMTChecker] Refactor VariableUsage 2019-04-05 11:38:37 +02:00
chriseth
3df4936b6f
Merge pull request #6179 from ethereum/solidity-yul1
Solidity to Yul compiler
2019-04-04 16:33:39 +02:00
chriseth
420a7dc3d6 Initial IR generator. 2019-04-04 15:02:42 +02:00
Daniel Kirchner
d0fda7ca7c
Merge pull request #6262 from ethereum/abiEncodeCalldataArray
ABIEncoderV2: implement encoding of calldata arrays and structs.
2019-04-04 14:51:45 +02:00
Daniel Kirchner
91a2a9a9c3 Implement ABI encoding of calldata arrays and structs. 2019-04-04 13:05:32 +02:00
chriseth
8c570f31c5
Merge pull request #6442 from ethereum/smt_unary_inc_dec
[SMTChecker] Support unary inc/dec for array/mapping access
2019-04-04 11:45:13 +02:00
Daniel Kirchner
d82157d46a Refactor abi encoding functions to prepare implementing calldata arrays and structs. 2019-04-04 11:18:03 +02:00
Daniel Kirchner
b0cb330397 Allow encoding calldata arrays for base types that do not require cleanup. 2019-04-04 11:18:03 +02:00
Alex Beregszaszi
43008dd08e Validate value types in decoder of ABIEncoderV2. 2019-04-03 11:32:02 +02:00
Leonardo Alt
aa9b9aa87e [SMTChecker] Support unary inc/dec for array/mapping access 2019-04-02 16:53:19 +02:00
Daniel Kirchner
ab8dfed144 Implement copying recursive structs from storage to memory. 2019-04-02 16:01:44 +02:00
chriseth
f9820adb5e
Merge pull request #6396 from ethereum/optSetForAsmStack
Make optimiser settings available to assembly stack.
2019-03-28 19:03:23 +01:00
chriseth
84251e5a22
Merge pull request #6405 from ethereum/smt_compound_assignment
[SMTChecker] Support arithmetic compound assignment operators.
2019-03-28 18:27:25 +01:00
chriseth
3264e9abf0 Make optimiser settings available to assembly stack. 2019-03-28 18:24:13 +01:00
Leonardo Alt
a7e826a224 [SMTChecker] Implement short circuit 2019-03-28 16:08:30 +01:00
Leonardo Alt
15269067b5 Support arithmetic compound assignment operators 2019-03-28 15:27:52 +01:00
Leonardo Alt
ecbf36f271 Refactor computing symbolic arithmetic operation 2019-03-28 15:27:36 +01:00
Leonardo Alt
1d63b97857 Take inlined function calls into account when collecting touched variables 2019-03-28 14:32:47 +01:00
Leonardo Alt
6f9b69ebc3 Refactor function that retrieves FunctionDefinition from FunctionCall 2019-03-28 14:32:47 +01:00
chriseth
529aca5cbd
Merge pull request #6407 from ethereum/changeNamespace
Remove "using namespace" from header and move Instruction to dev::eth.
2019-03-28 14:32:07 +01:00
chriseth
2308904f68 Remove "using namespace" from header and move Instruction to dev::eth. 2019-03-28 13:48:11 +01:00
chriseth
a1fe2562c4 Move suffixedVariableNameList to utils. 2019-03-27 17:14:17 +01:00
Alex Beregszaszi
d6dda7279c Change CompilerStack.reset to have keepSettings flag instead of keepSources 2019-03-26 14:46:13 +00:00
Alex Beregszaszi
cca73f9354 Remove deprecated CompilerStack.addSources 2019-03-26 14:46:02 +00:00
chriseth
72c0e44907
Merge pull request #6338 from ethereum/compilerstack-setsource
Introduce setSources in CompilerStack
2019-03-26 15:31:57 +01:00
chriseth
d079cdbfaa
Merge pull request #6362 from ethereum/fixABIEncoderV2StorageRead
Fix abi encoder v2 storage read
2019-03-26 10:23:08 +01:00
Alex Beregszaszi
a894ab4462
Merge pull request #6368 from ethereum/yul-standard-warnings
Add warning that Yul is still experimental
2019-03-25 22:48:46 +00:00
Alex Beregszaszi
d2185bf529 Remove obsolete identifer for the identity precompile 2019-03-25 20:57:59 +00:00
Alex Beregszaszi
e211b5b1e1 Add warning that Yul is still experimental 2019-03-25 20:17:11 +00:00
Alex Beregszaszi
0432401e20 Emit warning when using the Yul optimiser 2019-03-25 18:38:06 +01:00
chriseth
6b69c31703 Fix ABIEncoderV2 array overwrite bug. 2019-03-25 18:28:43 +01:00
chriseth
68d4a85575 Properly read and clean value types read from storage. 2019-03-25 18:28:43 +01:00
Alex Beregszaszi
0d6d0f476c Use setSources 2019-03-25 15:11:00 +00:00
Alex Beregszaszi
66a977d999 Introduce setSources in CompilerStack 2019-03-25 15:11:00 +00:00
chriseth
ffe3a60301
Merge pull request #6367 from ethereum/yul-standard
Allow warnings in AssemblyStack
2019-03-25 14:59:29 +01:00
Alex Beregszaszi
642d4b9217 Abort if parseAndAnalyze failed but no errors are reported in compileYul 2019-03-25 13:19:33 +00:00
Daniel Kirchner
66d6711364 ABIFunctions: Split out a function for generating a comma separated list of variable names. 2019-03-25 10:58:18 +01:00
Alex Beregszaszi
3bc2c35cc4 Support compiling Yul within StandardCompiler 2019-03-22 01:35:16 +00:00
Leonardo Alt
a207d7f44c [SMTChecker] Add callstack model to overflow checks 2019-03-21 16:25:33 +01:00
Leonardo Alt
de89733bd6 [SMTChecker] Fix nullptr deref 2019-03-21 15:46:54 +01:00
chriseth
d381e26fc8 Rename "enabled" optimizer setting stage to "standard". 2019-03-21 11:04:40 +01:00
Mathias Baumann
4c2b1c1f29 ArrayType::interfaceType(): Rename local variable to make more sense 2019-03-21 07:25:59 +01:00
Mathias Baumann
7d809df91a Add back StructType::recursive() 2019-03-21 07:25:59 +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
Alex Beregszaszi
ea1944bb2d Removed unused isLibrary from flag addSource in CompilerStack 2019-03-20 17:41:51 +00:00
chriseth
9aab2329ed
Merge pull request #6244 from ethereum/smt_modifiers
[SMTChecker] Support modifiers
2019-03-20 18:04:28 +01:00
chriseth
54e00b930d
Merge pull request #6331 from ethereum/pragma-parser-location-reporting-fix
Fixes wrong source location when reporting pragma solidity version conflicts
2019-03-20 16:07:56 +01:00
chriseth
8468dca0bb
Merge pull request #6323 from ethereum/bug-637
Fix function calls with named arguments for overloaded functions
2019-03-20 16:07:09 +01:00
chriseth
38cbf8d230 Pass "optimize stack allocation" flag down to the stack compressor. 2019-03-20 15:03:27 +01:00
Mathias Baumann
84b68006ba Fix function calls with named arguments for overloaded functions 2019-03-20 14:54:41 +01:00
Christian Parpart
bb28c8a877 Fixes wrong source location when reporting pragma solidity version conflicts. 2019-03-20 11:42:25 +01:00
Leonardo Alt
9659f40c8d [SMTChecker] Support modifiers 2019-03-20 11:32:20 +01:00
Leonardo Alt
3296fb3764 Add callstack to model report 2019-03-20 10:35:29 +01:00
chriseth
b021f015f9
Merge pull request #6321 from ethereum/metadata-cbor-encoder
Introduce simplfied CBOR encoding for Metadata
2019-03-20 10:10:16 +01:00
Leonardo Alt
9acec99c31 Issue error for callvalue in nonpayable function 2019-03-19 20:45:27 +01:00
chriseth
7c524f794f Also output optimized yul code if requested. 2019-03-19 17:24:36 +01:00
Alex Beregszaszi
7babe3dbba Introduce simplfied CBOR encoding for Metadata 2019-03-19 16:06:19 +00:00
chriseth
48f0d41cc5
Merge pull request #6294 from ethereum/merge-canBeUsedExternally-and-interfaceType-6223
Merge interfaceType() canBeUsedExternally()
2019-03-14 18:12:07 +01:00
Mathias Baumann
4d060ef991 Merge interfaceType() canBeUsedExternally()
And cache the result for expensive calls.
2019-03-14 17:19:59 +01:00
Mathias Baumann
3b546acd57 Clarify documentation of ContractType::m_super 2019-03-14 15:59:26 +01:00
chriseth
6d1ed93247 Use stack optimizations. 2019-03-14 15:34:23 +01:00
Erik Kundt
b9a7a88346 Improves Result<T> in order to prevent defects. 2019-03-14 14:33:28 +01:00
chriseth
2e7794d8a6 Defensively pad memory for `type(C).name` to multiples of 32. 2019-03-13 18:51:32 +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
chriseth
8445449c7f
Merge pull request #6187 from ethereum/filter-library-abi-3409
Exclude internal functions in library ABIs
2019-03-11 17:39:51 +01:00
chriseth
6683ec90ca
Merge pull request #6209 from ethereum/dynamicCalldataStructs
Allow dynamically encoded calldata structs with ABIEncoderV2.
2019-03-11 17:05:34 +01:00
Daniel Kirchner
66fc7ffab2 Allow dynamically encoded calldata structs with ABIEncoderV2. 2019-03-11 16:40:13 +01:00
Mathias Baumann
fbbd03dbd7 Exclude internal functions in library ABIs 2019-03-11 16:33:44 +01:00
Mathias Baumann
e411a502fd Fix missing trailing dot in error message 2019-03-11 16:15:18 +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
Mathias Baumann
d70cb375cf isImplicitlyConvertibleTo(): Add better error messages 2019-03-11 13:38:02 +01:00
Leonardo Alt
a8209e9899 [SMTChecker] Shortcut RationalNumber expressions 2019-03-11 12:53:49 +01:00
chriseth
4d8c57006b
Merge pull request #6195 from ethereum/extractYulUtils
[REF] Extract utility functions from ABI encoder.
2019-03-08 00:51:58 +01:00
chriseth
8b20ecb558 Refactor StandardCompiler to split into input parsing/validating and compilation steps. 2019-03-07 17:49:55 +01:00
Leonardo Alt
02d0e609b9 [SMTChecker] Support enums 2019-03-07 15:15:12 +01:00
Daniel Kirchner
f7c6eda2c3 Allow calldata arrays with dynamically encoded base type. 2019-03-06 18:04:12 +01:00
chriseth
cdf29277f7
Merge pull request #6055 from ethereum/smt_arrays
[SMTChecker] Add support to arrays
2019-03-06 18:00:23 +01:00
chriseth
dc69152238
Merge pull request #6143 from ethereum/fix-unimplemented-assert-5659
Check base contracts for abi encoder compatibility
2019-03-06 11:59:49 +01:00
chriseth
449141db2c
Merge pull request #6190 from ethereum/allowEncodeDecodeWithZeroParameters
Allow encoding and decoding functions with empty type list.
2019-03-06 11:57:21 +01:00
Leonardo Alt
29b2ab6f66 Handle aliasing 2019-03-06 11:29:54 +01:00
Leonardo Alt
467c34999f Do not throw on string literals 2019-03-06 11:29:26 +01:00
Leonardo Alt
e74f58130e Add SMT type support to Solidity arrays 2019-03-06 11:29:26 +01:00
Mathias Baumann
9919670ddd Check base contracts for abi encoder compatibility 2019-03-06 11:16:54 +01:00
Mathias Baumann
9052a8f050 Move FunctionType::returnParameters() to CallableDeclaration
all the other functions of that type are also found there.
2019-03-06 11:13:01 +01:00
Mathias Baumann
b2262d67f0 Remove unused variable Contractdefinition::m_linearizedBaseContracts 2019-03-06 11:13:01 +01:00
chriseth
d515d77bfe Extract utility functions from ABI encoder. 2019-03-05 22:13:55 +01:00
chriseth
a27ef3489c Allow encoding and decoding functions with empty type list. 2019-03-05 15:55:50 +01:00
Mathias Baumann
de98e38b78 Prepare code to output errors returned by isImplicitlyConvertibleTo() 2019-03-05 10:44:36 +01:00
chriseth
6c9961e040
Merge pull request #5941 from ethereum/metadata-compilerstack
Metadata should not require compilation
2019-03-04 18:53:07 +01:00
Alex Beregszaszi
a96cc6e0e8 Add allocateMemory helper with value known at compile time 2019-03-04 17:46:42 +01:00
chriseth
9c80f0fc76
Merge pull request #6155 from ethereum/defaultToPetersburg
Set default EVM version to petersburg
2019-03-04 17:36:42 +01:00
Alex Beregszaszi
fcbb8ec51c Allow returning metadata in StandardCompiler without compilation 2019-03-04 16:19:55 +01:00
Alex Beregszaszi
26ca144647 Cache metadata and allow after analysis in CompilerStack 2019-03-04 16:19:54 +01:00
Alex Beregszaszi
bd51589f1a Use "if" instead of "switch" in codegen for the deployment time address of a library 2019-03-04 15:16:58 +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
2e0ea16a0f
Merge pull request #5959 from ethereum/optimiser2
Introduce global optimiser settings.
2019-03-04 12:54:59 +01:00
chriseth
6a32f6e1ac Properly assign reference to context. 2019-03-04 12:00:47 +01:00
chriseth
851dd635eb Remove defaults in constructor arguments. 2019-03-04 11:41:52 +01:00
chriseth
83d1382e78 Take yul optimizer setting into account. 2019-03-04 11:40:28 +01:00
chriseth
1ff562d28a Provide full optimiser settings to ContractCompiler. 2019-03-04 11:40:28 +01:00
chriseth
4d10f4b4cf Process and validate standard-json optimizer settings. 2019-03-04 11:40:28 +01:00
Alex Beregszaszi
cf5c13f9c7 Introduce global optimiser settings. 2019-03-04 11:40:28 +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
Alex Beregszaszi
679ff78714 Restrict parse/analyse in CompilerStack 2019-02-28 13:59:33 +00:00
chriseth
6aab3b1369
Merge pull request #6139 from ethereum/compilerstack-restrict
Restrict the state when settings can be altered in CompilerStack
2019-02-28 14:52:52 +01:00
Alex Beregszaszi
b04b86a938 Restrict the state when settings can be altered in CompilerStack 2019-02-28 12:55:36 +00: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
chriseth
80417e3d8c
Merge pull request #6100 from ethereum/smt_dynamic_cast_types
[SMTChecker] Replace dynamic_cast by category check
2019-02-26 13:28:48 +01:00
chriseth
38fc740690
Merge pull request #6080 from ethereum/library-index-access
Disallow index access on contracts and libraries
2019-02-26 13:26:05 +01:00
Leonardo Alt
bbd2c91e19 [SMTChecker] Replace dynamic_cast by category check 2019-02-26 00:47:59 +01:00
Erik Kundt
2d0daae796 Disallows index access on contracts and libraries. 2019-02-25 23:05:33 +00:00
Alex Beregszaszi
358ccbe372 Properly issue unimplemented assertion on FixedPointType in type conversion 2019-02-25 21:21: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
fcf884f201 Do not ignore fatal error in AsmParser for inline assembly 2019-02-21 16:18:53 +00:00
Mathias Baumann
c65a96d189 Small documentation fixes in the code 2019-02-21 12:54:39 +01:00
chriseth
fb07462d82 Fix: Do use actual ABI signatures for events also in libraries instead of internal signature. 2019-02-20 14:35:24 +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
chriseth
d9e4a10d5a
Merge pull request #6000 from ethereum/fixECRecoverABIV2
Fixed internal error related to ecrecover and ABIEncoderV2.
2019-02-19 14:36:08 +01:00
chriseth
874648b924
Merge pull request #5999 from ethereum/smt_lazy_overflow
[SMTChecker] Check for under/overflow in the end of the function
2019-02-19 14:28:55 +01:00
chriseth
05541e5adb Fixed internal error related to ecrecover and ABIEncoderV2. 2019-02-19 14:17:03 +01:00
chriseth
d5791fef41 Fix combination of delegatecall and ABIEncoderV2.
We can set the flag to false for bare delegatecall, because we always
send a memory string and never a storage reference.
2019-02-19 13:57:03 +01:00
chriseth
55c4131a03
Merge pull request #6030 from ethereum/fixABIEncoderV2Mapping
Allow cleanup for mappings (do nothing).
2019-02-19 13:56:21 +01:00
Leonardo Alt
34470f3549 [SMTChecker] Only check for overflow/underflow in the end of the function 2019-02-18 23:55:58 +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
chriseth
c690f679cb Allow cleanup for mappings (do nothing). 2019-02-18 18:50:22 +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
Daniel Kirchner
d74198b3cc Remove misleading note in Type::calldataEncodedSize. 2019-02-18 16:18:40 +01:00
chriseth
cb0ad2266c
Merge pull request #6008 from ethereum/smt_fix_abstract_assignment
[SMTChecker] Assert type is not function when assigning
2019-02-18 14:54:20 +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
0408130338
Merge pull request #6003 from ethereum/moreStyleChecks
Even more style checks.
2019-02-15 11:52:32 +01:00
Leonardo Alt
22cdfb18d4 [SMTChecker] Assert type is not function when assigning 2019-02-14 13:32:56 +01:00
Daniel Kirchner
809b9a95f9 Even more style checks. 2019-02-14 11:53:00 +01:00
Daniel Kirchner
8ca6715e18 More style checks. 2019-02-14 11:41:20 +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
Daniel Kirchner
32190dac48 Add stride helpers to ArrayType. 2019-02-14 10:51:39 +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
chriseth
17ea467e5b Fix style of "const". 2019-02-13 16:34:53 +01:00
chriseth
d073eb1544 Move AssemblyStack to libyul. 2019-02-13 12:23:07 +01:00
chriseth
02373c2225 Adjust uses of AsmCodeGen. 2019-02-13 11:35:49 +01:00
chriseth
1ff6f2c71c Move AsmCodeGen. 2019-02-13 11:20:15 +01:00
Bhargava Shastry
7751fa740f Ensure we fail gracefully when user tries to optimize Yul code 2019-02-12 11:21:02 +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
chriseth
18c7ad08a0
Merge pull request #5925 from ethereum/stackCompressor
Stack compressor
2019-02-11 16:17:47 +01:00
chriseth
b34e104173 Make dialect a shared pointer. 2019-02-11 15:48:29 +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
chriseth
0c2d623ee4 Enable struct encoding. 2019-02-11 11:37:47 +01:00
chriseth
a08f4f43fa Add packed encoder V2. 2019-02-11 11:37:47 +01:00
chriseth
1b9d30f05f Packed encoding. 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
Leonardo Alt
4058978b3b Require Z3 >= 4.6.0 2019-02-07 14:24:40 +01:00
Leonardo Alt
637546850f [SMTChecker] Add mod operator 2019-02-07 14:24:40 +01:00
chriseth
9de652ab76
Merge pull request #5953 from ethereum/removeCheckCoveredByAssertion
Remove type check that is covered by assertions.
2019-02-07 12:19:14 +01:00
chriseth
fc18258250 Remove type check that is covered by assertions. 2019-02-07 12:02:15 +01:00
Mathias Baumann
5fb79f5e37 Turn unreachable error statements into asserts 2019-02-07 10:07:09 +01:00
chriseth
1236b23168
Merge pull request #5943 from ethereum/singleOutLengthUpdate
Extract storing length to its own function.
2019-02-06 14:46:39 +01:00
chriseth
49f8fa4cfe Extract storing length to its own function. 2019-02-06 14:03:49 +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
chriseth
77baf6caf7 Compilability checker. 2019-02-04 17:32:05 +01:00
chriseth
cd8cf7745b
Merge pull request #5888 from ethereum/betterStackErrorMessages
Better error message for out of stack in assembly.
2019-02-04 15:26:55 +01:00
Alex Beregszaszi
717727940d
Merge pull request #5909 from ethereum/c++17
Use specific boost include in DocStringParser
2019-01-31 13:55:27 +00:00
Alex Beregszaszi
021d30f036 Use specific boost include in DocStringParser
This is needed for C++17 support (at least on certain Boost and OS combinations)
2019-01-31 13:14:29 +00:00
chriseth
17a1e7aed5 Better error message for out of stack in assembly. 2019-01-30 12:24:10 +01:00
chriseth
35483422f3 Pad code to multiple of 32 bytes. 2019-01-30 11:31:28 +01:00
Leonardo Alt
9a33367bc6 [SMTChecker] Warn when no solver was found and there are unhandled queries. 2019-01-29 14:29:07 +01:00
Alex Beregszaszi
ee09d54525 Change FIXMEs into TODOs where appropriate 2019-01-29 00:35:23 +00:00
chriseth
e22a9ea5cf
Merge pull request #5883 from ethereum/fixInlineAssembly
Do not provide access to external assembly variables from within functions.
2019-01-28 15:12:43 +01:00
Alex Beregszaszi
9aafa32825 Disallow empty import statements 2019-01-28 13:52:15 +00:00
chriseth
64312584dc Do not provide access to external assembly variables from within functions. 2019-01-28 14:42:38 +01:00
chriseth
e3791d6dcf Fix reported packed encoded size for arrays and structs. 2019-01-23 11:13:22 +01:00
chriseth
ea292393a3
Merge pull request #5838 from maxsam4/useLiteralContent-patch
useLiteralContent data validation
2019-01-23 10:35:32 +01:00
Mudit Gupta
2f91781a80
useLiteralContent data validation
Squashed commit of the following:

commit bbceee6997c1b951eb6054f7d5b7560fe1773690
Author: Mudit Gupta <guptamudit@ymail.com>
Date:   Tue Jan 22 23:27:49 2019 +0530

    Removed extra check

commit 4f7c3cc58e94836b1dddcc5f2938da14adad6252
Author: Mudit Gupta <guptamudit@ymail.com>
Date:   Tue Jan 22 17:51:05 2019 +0530

    Updated test error message

commit 5da45f2a23840e7bb1978853e1c184faec65b3e0
Author: Mudit Gupta <guptamudit@ymail.com>
Date:   Tue Jan 22 17:46:09 2019 +0530

    Renamed test

commit e661418deac25f31c49091be3c80244f566fc14c
Author: Leonardo <leo@ethereum.org>
Date:   Tue Jan 22 17:41:56 2019 +0530

    Update libsolidity/interface/StandardCompiler.cpp

    Co-Authored-By: maxsam4 <guptamudit@ymail.com>

commit d289b4dc1956ab736aada613e810cf2e2d124d4d
Author: Mudit Gupta <guptamudit@ymail.com>
Date:   Tue Jan 22 17:29:40 2019 +0530

    changed style

commit 5a7cf08db3027d75081d2e698dd51b807bef5abb
Author: Mudit Gupta <guptamudit@ymail.com>
Date:   Tue Jan 22 17:20:37 2019 +0530

    Added test case for missing useLiteralContent

commit 6e866c46aa92d6a89f2b341bd717c3886946f3ff
Author: Mudit Gupta <guptamudit@ymail.com>
Date:   Tue Jan 22 17:09:30 2019 +0530

    input check for useLiteralContent
2019-01-23 10:22:27 +05:30
chriseth
628d665474
Merge pull request #5843 from ethereum/abi-typos
Do not ignore revertOnFailure flag when validating Address/Contract
2019-01-22 18:44:09 +01:00
Alex Beregszaszi
3f2898ea47 Do not ignore revertOnFailure flag when validating Address/Contract 2019-01-22 14:45:08 +00:00
chriseth
01e87cfc08 Refactor struct encoder. 2019-01-22 14:45:25 +01:00
chriseth
7b66eb273d
Merge pull request #5832 from ethereum/introduceEncodingOptions
[REF] Provide ABI encoding options as single struct parameter.
2019-01-21 23:53:21 +01:00
chriseth
7a69455c13 Provide ABI encoding options as single struct parameter. 2019-01-21 16:43:32 +01:00
Leonardo Alt
7f8ceaadab [SMTChecker] Clear state knowledge after external function calls 2019-01-21 12:58:40 +01:00
chriseth
f8e9aed839
Merge pull request #5717 from ethereum/smt_typecast
[SMTChecker] Support basic typecast without truncation
2019-01-21 12:35:07 +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
29f6aa7d56 Do not create a copy of the assembly. 2019-01-17 20:36:48 +01:00
chriseth
a9fa2658d8 Add helper to show if contract can be deployed. 2019-01-17 20:36:48 +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
e6fee257e6 Code generation for access to contract code. 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
Leonardo Alt
a10db051de [SMTChecker] Support basic typecast 2019-01-16 13:00:54 +01:00
Daniel Kirchner
0dfd4a726e Warn about unreachable code. 2019-01-10 10:36:50 +01:00
chriseth
9222eff08f Make the dialect available everywhere. 2019-01-07 16:41:03 +01:00
chriseth
ae08d7c375
Merge pull request #5681 from ethereum/limitOutput
Do not compile unless requested.
2018-12-19 17:02:28 +01:00
chriseth
4c7151e57f Do not include empty JSON objects in output. 2018-12-19 14:59:29 +01:00
chriseth
beae2a608b Only fully compile if binaries requested. 2018-12-19 12:58:17 +01:00
chriseth
4e89945d82 Some more compiler state tests. 2018-12-19 12:58:17 +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
Christian Parpart
d10bae245e
liblangutil: SourceLocation to default initialize data members (w/o the use of ctor)
See: http://isocpp.github.io/CppCoreGuidelines/CppCoreGuidelines#c45-dont-define-a-default-constructor-that-only-initializes-data-members-use-in-class-member-initializers-instead
2018-12-19 11:21:45 +01:00
chriseth
678a95f6e3
Merge pull request #5686 from ethereum/someStyle
Formatting.
2018-12-19 00:33:02 +01:00
chriseth
d8218b7eef Formatting. 2018-12-18 23:50:39 +01:00
chriseth
20189c3f3b
Merge pull request #5637 from ethereum/better-json-error-reporting
Json: Provide better error message when 'settings' is not an object
2018-12-18 19:39:46 +01:00
Mathias Baumann
c43d96f2bf Json: Provide better error messages for wrong types 2018-12-18 18:36:50 +01:00
chriseth
f5e52ef3c0
Merge pull request #5679 from ethereum/hashCache
Cache hash computations.
2018-12-18 18:23:27 +01:00
chriseth
e970590675
Merge pull request #5664 from ethereum/cmakeUpdates
Use imported CMake targets.
2018-12-18 17:45:23 +01:00
chriseth
bd52beedff Cache hash computations. 2018-12-18 16:38:25 +01:00
Alex Beregszaszi
c2ec6d71b4 Add version pragma parsing to Parser 2018-12-18 15:02:35 +00:00
chriseth
4e475cdbe9
Merge pull request #5625 from ethereum/single-check
Do check for callvalue only once if no payable functions
2018-12-18 11:36:58 +01:00
chriseth
4b43aecaeb
Merge pull request #5671 from ethereum/sort_includes_interface
Sort includes in libsolidity/interface
2018-12-18 11:35:56 +01:00
Mathias Baumann
1b8570f829 Only generate sort/search code when interface functions exist 2018-12-17 21:24:37 +01:00
Leonardo Alt
7f41487ff6 Sort includes in libsolidity/parsing 2018-12-17 19:28:10 +01:00
Leonardo Alt
340ee4156d Sort includes in libsolidity/interface 2018-12-17 19:24:42 +01:00
Leonardo Alt
cce377833a Sort includes in libsolidity/formal 2018-12-17 18:26:10 +01:00
chriseth
7d3727bbf7
Merge pull request #5665 from ethereum/cmakeHeaders
Add headers to targets in CMakeLists.txt.
2018-12-17 17:47:38 +01:00
chriseth
9ab6133f85
Merge pull request #5667 from ethereum/sort_includes_codegen
Sort includes in libsolidity/codegen
2018-12-17 17:46:53 +01:00
Leonardo Alt
ab76676271 Sort includes in libsolidity/codegen 2018-12-17 17:06:11 +01:00
Leonardo Alt
b185d01a26 Sort includes in libsolidity/ast 2018-12-17 15:33:15 +01:00
Daniel Kirchner
2f698b6efe Use imported CMake targets. 2018-12-17 15:15:11 +01:00
Daniel Kirchner
2353f73c39 Add headers to targets in CMakeLists.txt. 2018-12-17 15:01:02 +01:00
chriseth
332f914e4e
Merge pull request #5388 from ethereum/smt_mapping
[SMTChecker] Support for mapping
2018-12-17 14:09:52 +01:00
Leonardo Alt
36d8a98664 Sort includes in libsolidity/analysis 2018-12-17 12:35:16 +01:00
Leonardo Alt
9199718ec0 Clear all mapping knowledge after array variable assignment 2018-12-14 12:21:53 +01:00
Leonardo Alt
6a2809a582 [SMTChecker] Support to mapping 2018-12-14 12:21:53 +01:00
chriseth
6e205cc4e3
Merge pull request #5624 from ethereum/standard_json_unknown_keys
Disallow unknown JSON keys in standard-json
2018-12-13 09:58:34 +01:00
chriseth
b014732c81
Merge pull request #5638 from ethereum/header-guard
Add missing header guards
2018-12-12 18:41:58 +01:00
Leonardo Alt
8cd2ac8462 Disallow unknown JSON keys in standard-json 2018-12-12 17:32:42 +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
Alex Beregszaszi
c863cbf80d Add missing header guards 2018-12-12 15:47:05 +00: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
8d49e53995 Provide Dialect to EVMCodeTransform. 2018-12-11 19:24:31 +01:00
chriseth
9f86ede32d
Merge pull request #5454 from ethereum/smt_math_functions
[SMTChecker] Abstract math functions
2018-12-11 18:35:10 +01:00
chriseth
b5deca0383
Merge pull request #4779 from ethereum/optimise-string-literals
Decide better in storing string literals as data
2018-12-11 17:50:14 +01:00
Leonardo Alt
08737e43dc [SMTChecker] Use SymbolicFunctionVariable for uninterpreted functions 2018-12-11 11:28:25 +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
chriseth
53f531ecb0 Set codecopy limit for data to 32 bytes. 2018-12-10 17:11:48 +01:00
chriseth
871ea22bb9
Merge pull request #5008 from liangdzou/yul_stack_reuse
Reuse stack slots in Yul codegen
2018-12-10 16:14:33 +01:00
liangdzou
362648a450 Reuse stack slots in Yul to EVM code generation. 2018-12-10 14:28:56 +01:00
Leonardo Alt
de46bb2c42 [SMTChecker] Introduce SymbolicFunctionVariable 2018-12-10 11:34:29 +01:00
Erik Kundt
e2395a3dcf Adds more detailed type errors and tests. 2018-12-07 12:35:35 +01:00
Erik Kundt
b2afb8cdda Adds an additional message to failing type conversions. 2018-12-07 11:55:53 +01:00
chriseth
6a9e8a6fe3
Merge pull request #4936 from ethereum/binSelect
Binary search for dispatch.
2018-12-07 00:55:09 +01:00
chriseth
4b2a64306a
Merge pull request #5587 from ethereum/yulCodeBuiltins
Builtin functions to access Yul objects.
2018-12-06 16:49:52 +01:00
chriseth
3fc118ba21 Analyze and compile sub-objects. 2018-12-06 14:32:04 +01:00
chriseth
f6ed29b88b Extend abstract assembly to be able to handle sub-objects. 2018-12-06 14:32:04 +01:00
chriseth
4721cf332f Expose EthAssemblyAdapter. 2018-12-06 14:32:04 +01:00
chriseth
0e8841005c
Merge pull request #5554 from ethereum/cp-SourceReferenceFormatter-refactor
[2/3] Refactor SourceReferenceFormatter (split-out data extraction & make use of new SourceLocation knowledge)
2018-12-06 14:01:39 +01:00
Christian Parpart
073b03d90c liblangutil: refactor SourceReferenceFormatter, splitting out retrieval and making use of new SourceLocation's CharStream knowledge 2018-12-06 14:01:01 +01:00
chriseth
7f39c3e522 Binary search for dispatch. 2018-12-06 13:07:14 +01:00
chriseth
5fde279d2a
Merge pull request #5514 from corollari/develop
Remove unary + from the type system
2018-12-06 10:27:09 +01:00
Albert
df08d79623 Fix #5470
Remove unary + from the type system
2018-12-06 01:54:04 +01:00
chriseth
3a378eae1a Restrict toHex to bytes. 2018-12-05 22:37:05 +01:00
Kevin Kelley
fb6fd1b3c2 add a 'readable' format for large hex values 2018-12-05 22:15:02 +01:00
chriseth
63d67c7153
Merge pull request #5591 from ethereum/smt_simplify_sort
[SMTChecker] Simplify symbolic variables
2018-12-05 17:28:45 +01:00
Erik Kundt
e3accc6aa6 Simplifies Result<T> and prevents undefined behaviour. 2018-12-05 10:33:34 +01:00
Erik Kundt
05e74d096e Introduces Result<T> for operator and implicit conversion type checks. 2018-12-05 10:33:34 +01:00
Leonardo Alt
b9f424e373 [SMTChecker] Simplify symbolic variables 2018-12-05 09:56:52 +01:00
chriseth
6efe2a5266
Merge pull request #5390 from ethereum/smt_one_loop
[SMTChecker] Unroll loops once
2018-12-05 09:23:19 +01:00
chriseth
c8e201e520 Provide Yul Object builtins. 2018-12-04 15:40:50 +01:00
chriseth
7ee1ddc172 Switch namespaces. 2018-12-04 15:36:03 +01:00
chriseth
0b1125281a Remove some includes. 2018-12-04 15:31:00 +01:00
chriseth
3ebb78a886 Adjust include paths. 2018-12-04 15:20:29 +01:00
chriseth
0ec7a0e72c Move AsmCodeGen. 2018-12-04 15:20:23 +01:00
Leonardo Alt
8069bb61da [SMTChecker] Loops are unrolled once 2018-12-04 12:35:19 +01:00
chriseth
99db4e3ff4 Introduce the concept of builtin functions. 2018-12-04 12:06:33 +01:00
Anurag Dashputre
82f5763e7a Fix internal compiler error for unimplemented base contract function. 2018-12-03 12:25:31 +01:00
chriseth
4b98946e5a
Merge pull request #5341 from ethereum/optimizeAssemblyCommandline
Apply the optimize commandline parameter to assembly mode.
2018-12-03 11:52:48 +01:00
chriseth
5897b14d63
Merge pull request #5568 from ethereum/smt_remove_unary_plus
[SMTChecker] Remove unary plus operator
2018-12-03 11:19:34 +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
Leonardo Alt
6d41ffb4a5 [SMTChecker] Remove unary plus operator 2018-12-03 10:35:38 +01:00
chriseth
aaeb74f592
Merge pull request #5537 from ethereum/cp-SourceLocation-related-refactoring
[1/3] SourceLocation related refactoring.
2018-11-30 23:45:31 +01:00
chriseth
6c44c5f0c9 Apply the optimize commandline parameter to assembly mode. 2018-11-30 23:39:05 +01:00
Christian Parpart
435f7b3b72 liblangutil: Scanner: remove superfluous sourceName field (it's in CharStream already)
Also, ParserBase::sourceName() was dead code. Eliminating it should
increase test coverage (how sneaky) :-)
2018-11-30 17:07:17 +01:00
Christian Parpart
c48a5264be
liblangutil: SourceLocation: adds (shared) pointer to underlying CharStream source, eliminating sourceName
Also, adapted affecting code to those changes.
2018-11-30 17:07:12 +01:00
chriseth
cc00d8172b
Merge pull request #5528 from ethereum/smt_sorts_virtual
[SMTChecker] Make smt::Sort::operator== virtual
2018-11-30 16:48:46 +01:00
chriseth
33d6a24c47 Move library related checks. 2018-11-30 16:30:20 +01:00
chriseth
4f992298c6 Move hash collisions checks. 2018-11-30 16:30:19 +01:00
chriseth
6d1644e55c Move external type clash check. 2018-11-30 16:30:19 +01:00
chriseth
4f4f623273 Move fallback function checks. 2018-11-30 16:30:19 +01:00
chriseth
2a85152463 Move constructor checks. 2018-11-30 16:30:19 +01:00
chriseth
b610be4882 Rename functions. 2018-11-30 16:30:19 +01:00
chriseth
d1cc731843 No need to visit structs early. 2018-11-30 16:30:19 +01:00
chriseth
2c2c976697 Move base constructor argument checks. 2018-11-30 16:30:19 +01:00
chriseth
57a62429c9 Move abstract function check. 2018-11-30 16:30:19 +01:00
chriseth
89cf6a5a38 Move override checks. 2018-11-30 16:30:19 +01:00
chriseth
d054a3b85d Move duplication checks. 2018-11-30 16:30:19 +01:00
chriseth
0bd9db480f Add skeleton for contract level checker. 2018-11-30 16:30:19 +01:00
Leonardo Alt
2f6de12e8c [SMTChecker] Make smt::Sort::operator== virtual 2018-11-30 10:41:15 +01:00
chriseth
d6d41b2bc7
Merge pull request #5548 from ethereum/fixMemberAccess
Fix bug related to state variables of function type accessed via base contract.
2018-11-30 09:26:08 +01:00
chriseth
c445e7dfa4 Disallow inline arrays of mapping type. 2018-11-29 19:45:06 +01:00
chriseth
73a64da041 Fix bug related to state variables of function type accessed via base contract. 2018-11-29 19:30:27 +01:00
chriseth
124a8def84
Merge pull request #5543 from ethereum/fixSortMOve
Fix move bug.
2018-11-29 16:13:24 +01:00
chriseth
9e9250c961 Fix move bug. 2018-11-29 15:32:38 +01:00
Leonardo Alt
67bbcefe6c Report deprecation error on functions sha3 and suicide also without call. 2018-11-29 14:29:13 +01:00
Christian Parpart
22eff22492 liblangutil: extends CharStream to know about the respective (file-)name (and adapt codebase to it) 2018-11-29 12:45:27 +01:00
chriseth
f6d013237d
Merge pull request #5538 from hydai/static_uint256
Replace IntegerType(256) with static function IntegerType::uint256()
2018-11-29 11:17:33 +01:00
Leonardo Alt
1d47919c0c Fix ICE when function type struct parameter has field of non-existent type 2018-11-29 10:38:47 +01:00
hydai
9326adc3db Replace IntegerType(256) with static function IntegerType::uint256() 2018-11-29 17:07:18 +08:00
chriseth
b4086ac870
Merge pull request #5526 from ethereum/fixGetterNewCoder
Fix: Disallow structs in getters for old encoder.
2018-11-28 17:05:52 +01:00
chriseth
46f3da0b87 Properly check getter types to be old-abi-coder-compatible. 2018-11-28 14:08:25 +01:00
chriseth
5c0331a058
Merge pull request #5525 from ethereum/obsoleteComment
Remove obsolete comment.
2018-11-28 12:23:12 +01:00
chriseth
4fa47322f9 Remove obsolete comment. 2018-11-28 11:49:00 +01:00
chriseth
728119bb11 Use yul parser in assembly stack. 2018-11-27 15:59:57 +01:00
chriseth
e016cb99e6 Yul objects. 2018-11-27 15:59:57 +01:00
chriseth
240ad0e34e
Merge pull request #5382 from ethereum/libraryMappingPublic
Allow mapping arguments for public and external library functions.
2018-11-26 19:47:32 +01:00
chriseth
4d7799eed4 Properly disallow different return types for interface overloads with different visibilities. 2018-11-26 16:51:28 +01:00
chriseth
f937896727
Merge pull request #5445 from ethereum/publicExternalOverwrite
Allow overwriting external functions (with ``calldata`` arguments) with public functions (with ``memory`` arguments)
2018-11-26 16:50:40 +01:00
Daniel Kirchner
30e6f8d3fb Allow mapping arguments for public and external library functions. 2018-11-26 16:31:46 +01:00
chriseth
f6d8810103
Merge pull request #5504 from ethereum/smt_fix_emscripten
[SMTChecker] Fix crash when SMTLib2Interface reports unknow for constant checks
2018-11-26 16:14:02 +01:00
chriseth
764d618c44
Merge pull request #5404 from ethereum/jumpFixes
Annotate jump from calldata decode to function as "jump in".
2018-11-26 16:08:04 +01:00
chriseth
a46d5c6580 Fix merge problem in CMake files. 2018-11-26 14:50:04 +01:00
chriseth
d950905a28
Merge pull request #5493 from ethereum/cmake-no-globbing
[WIP] CMake: Explicitly state which files to compile instead of relying on globbing
2018-11-26 14:45:35 +01:00
Christian Parpart
cdd8c72c9d CMake: Explicitly state which files to compile instead of relying on globbing.
Also remove header file lists, as there is no need to add them to
add_library() or add_executable(), which should lower maintenance of the cmake files.
2018-11-26 14:39:24 +01:00
chriseth
5ec634939e Use asCallableFunction for definition clashes in the same contract. 2018-11-26 14:30:32 +01:00
chriseth
36a369d077 Use asCallableFunction for external interface clash check. 2018-11-26 14:30:32 +01:00
chriseth
939365a1d5 Use callable types for override check. 2018-11-26 14:30:32 +01:00
chriseth
9a4968ba1d Use asCallableFunction in override check (part 1). 2018-11-26 14:30:32 +01:00
chriseth
7921e5f0b9
Merge pull request #5486 from ethereum/allowExternalPublicOverride
Allow external public override
2018-11-26 14:26:55 +01:00
chriseth
9ac7c748f8
Merge pull request #5494 from ethereum/scanner-error-handling
Improved Scanner error diagnostics.
2018-11-26 14:17:08 +01:00
Leonardo Alt
aaaa92012c [SMTChecker] Unknown answer for constant condition check should not do anything 2018-11-26 12:54:02 +01:00
chriseth
0b474d5299
Merge pull request #5497 from ethereum/langutil-SourceReferenceFormatter
Moving SourceReferenceFormatter into langutil namespace.
2018-11-26 12:44:25 +01:00
chriseth
0f0e466d36 Allow visibility change from external to public. 2018-11-26 12:41:26 +01:00
chriseth
bc137c2eeb
Merge pull request #5485 from ethereum/refactorCallableFunction
Refactor callable function
2018-11-26 12:34:43 +01:00
chriseth
0e08fb7469 Use "in" tag for jumps from unpacker to function. 2018-11-26 11:02:58 +01:00
Christian Parpart
e4106bd06e Change scanner error diagnostics to be non-intrusive to the token API.
This also implicitly eliminates the magic-token Token::IllegalHex, and
streamlines error diagnostics over a custom enum class.
2018-11-24 12:40:51 +01:00
Christian Parpart
aeb66905de
Moving SourceReferenceFormatter into langutil namespace. 2018-11-24 12:33:36 +01:00
Lazaridis
e454737a3c adapt to latest code changes 2018-11-23 17:27:52 +01:00
chriseth
9a94e503da
Merge pull request #5491 from ethereum/libyul-as-library
Libyul as static library (version 3 ;( )
2018-11-23 17:01:18 +01:00
Christian Parpart
ec47c8946b
Isolating libyul library API into its own namespace yul. 2018-11-23 14:29:00 +01:00
Christian Parpart
3734f40d31 CMake: Isolate libyul into its own static library 2018-11-23 12:37:37 +01:00
Christian Parpart
713d94476e Reorder some include files and group <libyul/>'s together (as much as possible) 2018-11-23 12:37:19 +01:00
Christian Parpart
0f4ed52a71
Rewrite header paths to adapt to recent git mv of libsolidity/inlineasm to libyul 2018-11-23 11:18:57 +01:00
Christian Parpart
10e6d2897d
Moving files from libsolidity/inlineasm/*.{cpp,h} to libyul/. 2018-11-23 11:16:52 +01:00
Leonardo Alt
6251a289dd Testing with smtlib2 interface always there 2018-11-23 09:43:49 +01:00
Leonardo Alt
dee0c4ded8 Error message stays in the SMTChecker 2018-11-23 09:43:49 +01:00
Leonardo Alt
f3c2309c73 Display better error message in SMTLib2 2018-11-23 09:43:49 +01:00
Leonardo Alt
f44be616c9 Renaming json fields smtlib2queries and smtlib2responses 2018-11-23 09:43:49 +01:00
chriseth
54bed454f6 Rename function and warn if responses are supplied for Z3. 2018-11-23 09:43:49 +01:00
chriseth
bb10be789c Inject SMTLIB2 queries and responses via standard-json-io. 2018-11-23 09:43:49 +01:00
chriseth
d686807153 Style 2018-11-22 21:13:02 +01:00
chriseth
ecd059cb92
Merge pull request #5451 from ethereum/bound_function_tests
Add assert and tests for bound functions
2018-11-22 18:23:46 +01:00
chriseth
a781bda595 Correct style. 2018-11-22 17:15:25 +01:00
Leonardo Alt
ec84a7dc9b [SMTChecker] Refactor setZeroValue and setUnknownValue 2018-11-22 16:42:51 +01:00
chriseth
62e801ed70 Use callable function for virtual resolution. 2018-11-22 15:48:12 +01:00
chriseth
92ba8a95f6 Make asCallableFunction to never fail and assert abount parameter size if bound instead. 2018-11-22 15:47:45 +01:00
chriseth
9e964852cc Rename 'asMemberFunction' to widen its purpose. 2018-11-22 15:24:45 +01:00
Leonardo Alt
06189ae57f Add assert and tests for bound functions 2018-11-22 14:41:39 +01:00
Leonardo Alt
20accf1a90 [SMTChecker] Add ArraySort and array operations 2018-11-22 14:04:20 +01:00
Leonardo Alt
13a142b039 [SMTChecker] Add FunctionSort and refactors the solver interface to create variables 2018-11-22 10:04:04 +01:00
Christian Parpart
d67322a186 Introduce namespace langutil in liblangutil directory.
Also:
- Use {}-style list initialisation for SourceLocation construction
- Introduce new system includes
- Changes the API of the Scanner to take source as value (with move) as opposed to as a reference
2018-11-21 19:13:44 +00:00
Christian Parpart
80371e2d25 Ensure liblangutil is compiled and linked as its own static library. 2018-11-21 18:58:36 +00:00
Christian Parpart
87821c53c3 Isolating files shared between Yul- and Solidity language frontend. 2018-11-21 18:58:12 +00:00
Alex Beregszaszi
2c6e1888eb
Merge pull request #5466 from ethereum/smt_refactor_sort_patch1
[SMTChecker] Refactor smt::Sort and its usage
2018-11-21 15:17:58 +00:00
Leonardo Alt
01ce43e51b [SMTChecker] Refactor smt::Sort and its usage 2018-11-21 15:46:47 +01:00
mordax
ea8b7d803e Removing redundant virtual from override function declaration
Remove trailing whitespace

Remove changelog change
2018-11-21 14:37:32 +00:00
Leonardo Alt
06c3f0953a [SMTChecker] Support bound function calls 2018-11-19 15:29:00 +01:00
Leonardo Alt
70bb0eaf95 [SMTChecker] Implement uninterpreted functions and use it for blockhash() 2018-11-15 09:12:42 +01:00
chriseth
727e3f24bc Do not perform cleanup on unsigned integers when loading from calldata. 2018-11-14 20:52:30 +00:00
Alex Beregszaszi
d60cab1983 Add CompilerStack state assertions in internal methods 2018-11-14 10:47:26 +00:00
Alex Beregszaszi
be70703f82 Move lastContractName closer to contractNames 2018-11-14 10:29:16 +00:00
Alex Beregszaszi
5778af07a3 Do not crash on filesystemFriendlyName if no contracts were compiled 2018-11-14 10:29:16 +00:00
Leonardo Alt
9a4fd946c3 Add Scanner function that prints source based on SourceLocation 2018-11-13 13:49:29 +01:00
chriseth
7e0041cf22
Merge pull request #5406 from ethereum/uninitializedStorageUnimplemented
Ignore unimplemented functions for detecting uninitialized storage returns.
2018-11-13 13:22:59 +01:00
Daniel Kirchner
b5e9d849ef Ignore unimplemented functions for storage returns. 2018-11-13 12:18:22 +01:00
Daniel Kirchner
74557ceb0e Deterministic YulStringRepository using string hashes. 2018-11-12 23:43:16 +01:00
chriseth
2cc304fd3f Fix for style. 2018-11-12 09:15:22 +01:00
chriseth
af65bac737 Remove trailing whitespace. 2018-11-12 09:15:22 +01:00
Kristofer Peterson
f927da9182 Refactor of bool TypeChecker::visit(FunctionCall const& _functionCall).
Visit method now cleanly determines if node represents a function call,
struct construction or type conversion. Type checking, validation and
error message logic is moved to separate methods.
2018-11-09 16:35:54 +00:00
chriseth
0f2ba3522f Reset yul string repository. 2018-11-09 15:40:36 +01:00
chriseth
6bbedab383
Merge pull request #5265 from ethereum/cleanupsha3
Simplify sha3.
2018-11-09 15:39:57 +01:00
chriseth
b801e61611
Merge pull request #5365 from ethereum/improveNameDispenser
[Yul] Use single counter for name dispenser for performance reasons.
2018-11-08 12:24:21 +01:00
Daniel Kirchner
fce1c3a9e7
Merge pull request #5370 from ethereum/fixWindows
Fix windows build.
2018-11-08 12:06:32 +01:00
chriseth
1f4ecff446 Fix windows build. 2018-11-08 11:30:58 +01:00