We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
2 parents b03323e + daf6742 commit 0040758Copy full SHA for 0040758
Public/TestEVM/FromBugs/CERT-9946/C.sol
@@ -0,0 +1,21 @@
1
+contract C {
2
+ uint256 fooCalled = 0;
3
+ uint256 barCalled = 0;
4
+ function foo(address x, address z) public returns (uint) {
5
+ if(x == address(0)){
6
+ return 0;
7
+ }
8
+ address(x).call(abi.encodeWithSignature("bar(address,address)"));
9
+ fooCalled = fooCalled + 1;
10
+ return 1;
11
12
+
13
+ function bar(address y, address z) public returns (uint) {
14
+ if(y == address(0)){
15
16
17
+ address(y).call(abi.encodeWithSignature("foo(address,address)"));
18
+ barCalled = barCalled + 1;
19
20
21
+}
Public/TestEVM/FromBugs/CERT-9946/C.spec
@@ -0,0 +1,13 @@
+methods {
+ function currentContract._ external => HAVOC_ALL;
+ function _.bar(address, address) external => DISPATCHER(true);
+rule recurse(method f) {
+ address x;
+ address y;
+ env e;
+ require currentContract.fooCalled == 0 && currentContract.barCalled == 0, "Some initial values";
+ foo(e, x, y);
+ satisfy currentContract.fooCalled == 999 && currentContract.barCalled == 42, "there should be a HAVOC_ALL that will allow these values";
Public/TestEVM/FromBugs/CERT-9946/Default.conf
@@ -0,0 +1,6 @@
+{
+ "files": [
+ "C.sol",
+ ],
+ "verify": "C:C.spec",
Public/TestEVM/FromBugs/CERT-9946/expectedDefault.json
@@ -0,0 +1,5 @@
+ "rules": {
+ "recurse": "SUCCESS"
lib/GeneralUtils/src/main/kotlin/utils/ExtStdlib.kt
@@ -1312,6 +1312,8 @@ fun ClosedRange<BigInteger>.stepBy(step: BigInteger) = sequence<BigInteger> {
1312
}
1313
1314
1315
+fun UInt.checkedMinus(other: UInt): UInt? = if (this >= other) { this - other } else { null }
1316
1317
/**
1318
Runs the given [block] returns its result wrapped in a [Result]. Any exceptions other than [CancellationException]
1319
are caught and returned as a failure result. If a [CancellationException] is thrown, it is rethrown, allowing this
lib/Shared/src/main/kotlin/config/Config.kt
@@ -969,7 +969,21 @@ object Config {
969
val MoveModulePath =
970
object : ConfigType.StringCmdLine(
971
null,
972
- Option("movePath", true, "Directory to search for Move modules")
+ Option(
973
+ "movePath",
974
+ true,
975
+ "Directory to search for Move modules. Ordinarily derived from the spec package path."
976
+ )
977
+ ) {}
978
979
+ val SuiPackageSummaryPath =
980
+ object : ConfigType.StringCmdLine(
981
+ null,
982
983
+ "suiPackageSummaryPath",
984
985
+ "Directory with Sui package summary info. Ordinarily derived from the spec package path."
986
987
) {}
988
989
val MovePublicSanityCheck = object : ConfigType.BooleanCmdLine(
lib/Shared/src/main/kotlin/config/DestructiveOptimizationsModeEnum.kt
@@ -19,6 +19,7 @@ package config
import cli.ConversionException
import cli.Converter
22
+import datastructures.stdcollections.*
23
24
enum class DestructiveOptimizationsModeEnum {
25
/** Disable destructive optimizations */
@@ -42,3 +43,12 @@ val DestructiveOptimizationsModeConverter = Converter {
42
43
else -> throw ConversionException(it, DestructiveOptimizationsModeEnum::class.java)
44
45
46
47
+fun DestructiveOptimizationsModeEnum.isTwoStageMode(): Boolean {
48
+ return when(this) {
49
+ DestructiveOptimizationsModeEnum.TWOSTAGE,
50
+ DestructiveOptimizationsModeEnum.TWOSTAGE_CHECKED -> true
51
+ DestructiveOptimizationsModeEnum.DISABLE,
52
+ DestructiveOptimizationsModeEnum.ENABLE -> false
53
54
lib/Shared/src/main/kotlin/config/ReportTypes.kt
@@ -190,7 +190,6 @@ enum class ReportTypes(val loggerCategory: LoggerTypes) : DumpType, CategoryName
190
REMOVE_UNUSED_WRITES(LoggerTypes.OPTIMIZE),
191
REMOVE_UNUSED_PARTITIONS(LoggerTypes.OPTIMIZE),
192
REWRITE_COPY_LOOP(LoggerTypes.OPTIMIZE),
193
- REMOVE_CALL_ANNOTATIONS(LoggerTypes.OPTIMIZE),
194
PATH_OPTIMIZE0(LoggerTypes.OPTIMIZE),
195
MATERIALIZE_DISJOINT_HASHES(LoggerTypes.INSTRUMENTATION),
196
ASSUME_STRICT_MONOTONIC_FP(LoggerTypes.INSTRUMENTATION),
@@ -239,7 +238,7 @@ enum class ReportTypes(val loggerCategory: LoggerTypes) : DumpType, CategoryName
239
238
AXIOM_INLINING(LoggerTypes.INSTRUMENTATION),
240
CANONICALIZE_SCALARSET(LoggerTypes.OPTIMIZE),
241
GHOST_SUM_INSTRUMENTER(LoggerTypes.INSTRUMENTATION),
242
- SNIPPET_REMOVAL(LoggerTypes.PRUNING),
+ ANNOTATION_REMOVAL(LoggerTypes.PRUNING),
243
ENVFREE(LoggerTypes.SPEC),
244
CANONICALIZATION(LoggerTypes.SPEC),
245
STORAGE_REWRITER(LoggerTypes.INLINER),
0 commit comments