Skip to content

Commit 62aa02e

Browse files
feli-citascommit-bot@chromium.org
authored andcommitted
[dart/vm] Fix type of loop variable to int
Rationale: Some programs generated by dartfuzz.dart cause failures when executed due to the type of a loop variable being inferred as 'num'. By setting the type of such variables explicitly to 'int' we avoid such cases. Change-Id: Ibdfd06ece28914ee26fd38f2b3efa20cd93ba9ca Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/112754 Commit-Queue: Felicitas Hetzelt <[email protected]> Reviewed-by: Aart Bik <[email protected]> Reviewed-by: Ben Konyi <[email protected]>
1 parent 09bee6c commit 62aa02e

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

runtime/tools/dartfuzz/dartfuzz.dart

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ import 'dartfuzz_api_table.dart';
1313
// Version of DartFuzz. Increase this each time changes are made
1414
// to preserve the property that a given version of DartFuzz yields
1515
// the same fuzzed program for a deterministic random seed.
16-
const String version = '1.16';
16+
const String version = '1.17';
1717

1818
// Restriction on statements and expressions.
1919
const int stmtLength = 2;
@@ -294,7 +294,7 @@ class DartFuzz {
294294
// Emit a simple membership for-in-loop.
295295
bool emitForIn(int depth) {
296296
int i = localVars.length;
297-
emitLn('for (var $localName$i in ', newline: false);
297+
emitLn('for (int $localName$i in ', newline: false);
298298
emitExpr(0, rand.nextBool() ? DartType.INT_LIST : DartType.INT_SET);
299299
emit(') {', newline: true);
300300
indent += 2;

0 commit comments

Comments
 (0)