solidity/test/libsolidity
Martin Blicha 12bca24774 [SMTChecker] Use path condition when creating CHC targets
Without path condition, verification targets created inside ternary
operator ignore the condition of the operator inside the branches.
This led to false positives.

Further updates:

- Function calls should consider the conditions under which they are
called, otherwise the analysis may report false positives.
The fix proposed here is to add the current path condition to the edge
that propagates error from a function call.

- Increment error index after function call

This is necessary for the analysis of the ternary operator to work
correctly. No information should leak from a function call inside a
ternary operator in the first branch to the second branch, including
whether or not an error would have occured in the first branch.

However, for the execution that continues after the function call,
we still need to ensure that under the current path condition
the error has not occurred in that function call.

It would be better to isolate the analysis of the branches to separate
clauses, but I do not see an easy way for that now. In this way, even
though the function call in first branch is included in the clause of
the second branch, no information leaks.

- Additonal test for ternary operator

This tests the behaviour of SMTChecker on ternary operator with function
calls inside both branches. Specifically, it tests that SMTChecker
successfully detects a violation of a verification target in the second
branch when the same target is present also in the first branch, but
there it cannot be triggered because of the operator's condition.
2023-04-21 18:56:34 +02:00
..
ABIJson feat: allow named parameters in mapping types 2022-12-08 11:56:58 +01:00
analysis User-defined operators: Tests 2023-02-22 00:40:03 +01:00
ASTJSON Adds NatSpec to AST for struct definitions. 2023-04-18 13:10:21 +02:00
errorRecoveryTests feat: allow named parameters in mapping types 2022-12-08 11:56:58 +01:00
gasTests Fix wrong cleanup when copying from calldata to memory 2022-08-08 13:07:16 +02:00
interface Allow running Eldarica from the command line 2022-11-22 21:16:45 +01:00
lsp Adds natspec to AST for enum definition. 2023-04-05 14:58:32 +02:00
memoryGuardTests Tests. 2022-03-02 17:07:11 +01:00
semanticTests Fix calldata handling during creation in EVMHost. 2023-04-18 12:53:50 +02:00
smtCheckerTests [SMTChecker] Use path condition when creating CHC targets 2023-04-21 18:56:34 +02:00
syntaxTests Merge pull request #14139 from ethereum/make-plus-binary-only 2023-04-18 21:20:31 +02:00
util fix emit statments being printed on the same line 2022-10-25 19:22:07 +02:00
ABIDecoderTests.cpp
ABIEncoderTests.cpp Improve FunctionSelector helpers 2022-09-27 17:58:32 +02:00
ABIJsonTest.cpp
ABIJsonTest.h
ABITestsCommon.h
AnalysisFramework.cpp Improve FunctionSelector helpers 2022-09-27 17:58:32 +02:00
AnalysisFramework.h docs: fix typos 2022-12-25 22:39:50 +01:00
Assembly.cpp Add new info severity 2021-09-13 22:48:22 +02:00
ASTJSONTest.cpp Rename ASTJsonConverter to ASTJsonExporter 2022-06-16 18:05:51 +02:00
ASTJSONTest.h Use sol file to validate test variants 2022-03-14 14:21:30 +01:00
ErrorCheck.cpp Cleaning up helpers around errors 2022-09-19 10:51:14 +05:30
ErrorCheck.h
GasCosts.cpp test: some tests for push0 2023-04-12 00:10:24 +02:00
GasMeter.cpp Improve FunctionSelector helpers 2022-09-27 17:58:32 +02:00
GasTest.cpp Add std:: qualifier to move() calls 2022-08-30 11:12:15 +02:00
GasTest.h
Imports.cpp
InlineAssembly.cpp Add experimental EOF options for CLI and Standard JSON. 2022-11-23 19:53:44 +01:00
LibSolc.cpp
MemoryGuardTest.cpp Tests. 2022-03-02 16:42:28 +01:00
MemoryGuardTest.h Tests. 2022-03-02 16:42:28 +01:00
Metadata.cpp Add experimental EOF options for CLI and Standard JSON. 2022-11-23 19:53:44 +01:00
SemanticTest.cpp Add experimental EOF options for CLI and Standard JSON. 2022-11-23 19:53:44 +01:00
SemanticTest.h Add experimental EOF options for CLI and Standard JSON. 2022-11-23 19:53:44 +01:00
SemVerMatcher.cpp Fix another instance of the spurious unreachable warning, this time in SemVerMatcher 2022-11-29 23:26:22 +01:00
SMTCheckerTest.cpp group unsupported warnings 2023-03-15 17:06:06 +01:00
SMTCheckerTest.h Add SMTCheckerTest isoltest option to ignore invariants 2021-10-26 11:30:30 +02:00
SolidityCompiler.cpp test: some tests for push0 2023-04-12 00:10:24 +02:00
SolidityEndToEndTest.cpp docs: fix typos 2022-12-25 22:39:50 +01:00
SolidityExecutionFramework.cpp Add experimental EOF options for CLI and Standard JSON. 2022-11-23 19:53:44 +01:00
SolidityExecutionFramework.h Add experimental EOF options for CLI and Standard JSON. 2022-11-23 19:53:44 +01:00
SolidityExpressionCompiler.cpp test: some tests for push0 2023-04-12 00:10:24 +02:00
SolidityNameAndTypeResolution.cpp
SolidityNatspecJSON.cpp Adds NatSpec to AST for struct definitions. 2023-04-18 13:10:21 +02:00
SolidityOptimizer.cpp Adds support for the EVM version "Paris". 2023-01-23 18:50:36 +00:00
SolidityParser.cpp Add new info severity 2021-09-13 22:48:22 +02:00
SolidityTypes.cpp Adds NatSpec to AST for struct definitions. 2023-04-18 13:10:21 +02:00
StandardCompiler.cpp Update default evm version to paris 2023-01-30 17:57:08 +01:00
SyntaxTest.cpp Cleaning up helpers around errors 2022-09-19 10:51:14 +05:30
SyntaxTest.h
ViewPureChecker.cpp