[dart/fuzzer] Avoid OOM situations that may yield false divergence
Bug:
https://github.com/dart-lang/sdk/issues/34688
https://github.com/dart-lang/sdk/issues/34681
Change-Id: Ia6426e2f6415294352d2a3bd3c10ed575ad8c261
Reviewed-on: https://dart-review.googlesource.com/c/78384
Reviewed-by: Aart Bik <ajcbik@google.com>
Commit-Queue: Aart Bik <ajcbik@google.com>
diff --git a/runtime/tools/dartfuzz/dartfuzz.dart b/runtime/tools/dartfuzz/dartfuzz.dart
index 9a36b2b..d2986d7 100644
--- a/runtime/tools/dartfuzz/dartfuzz.dart
+++ b/runtime/tools/dartfuzz/dartfuzz.dart
@@ -10,7 +10,7 @@
// Version of DartFuzz. Increase this each time changes are made
// to preserve the property that a given version of DartFuzz yields
// the same fuzzed program for a deterministic random seed.
-const String version = '1.1';
+const String version = '1.2';
// Restriction on statement and expression depths.
const int stmtDepth = 5;
@@ -607,7 +607,7 @@
emitTerminal(tp); // resort to terminal
return;
}
- DartLib lib = oneOf<DartLib>(getLibrary(tp));
+ DartLib lib = oneOf(getLibrary(tp));
List<DartType> proto = lib.proto;
// Receiver.
if (proto[0] != null) {
@@ -862,15 +862,16 @@
DartLib('toLowerCase', [DartType.STRING]),
DartLib('toUpperCase', [DartType.STRING]),
DartLib('substring', [DartType.STRING, DartType.INT]),
- DartLib('padLeft', [DartType.STRING, DartType.INT]),
- DartLib('padRight', [DartType.STRING, DartType.INT]),
DartLib('replaceRange',
[DartType.STRING, DartType.INT, DartType.INT, DartType.STRING]),
DartLib('remove', [DartType.INT_STRING_MAP, DartType.INT]),
+ // Avoid (OOM divergences, unless we restrict parameters):
+ // DartLib('padLeft', [DartType.STRING, DartType.INT]),
+ // DartLib('padRight', [DartType.STRING, DartType.INT]),
];
} else if (tp == DartType.INT_LIST) {
return const [
- DartLib('sublist', [DartType.INT_LIST, DartType.INT]),
+ DartLib('sublist', [DartType.INT_LIST, DartType.INT])
];
} else {
assert(false);
diff --git a/runtime/tools/dartfuzz/dartfuzz_test.dart b/runtime/tools/dartfuzz/dartfuzz_test.dart
index 12cc75db5..a100fdf 100644
--- a/runtime/tools/dartfuzz/dartfuzz_test.dart
+++ b/runtime/tools/dartfuzz/dartfuzz_test.dart
@@ -20,7 +20,7 @@
/// Result of running a test.
class TestResult {
- TestResult(this.code, this.output);
+ const TestResult(this.code, this.output);
final ResultCode code;
final String output;
}