5c7b07f783
Rationale: Found by DartFuzz. One of the trickier bugs I had to debug. While building the flow graph from kernel, the finalizer builder expects the program context to be in the same state as when the finalizer was seen first, not the context seen by the breaking/continuing statement. This was done partially, but only partially. Finding loop context or breakable and switchable blocks was missing. Something only a fuzzer can find :-) https://github.com/dart-lang/sdk/issues/36076 Change-Id: Ie63912c5fad4d3c15f6559b60cc102b237949957 Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/95720 Commit-Queue: Aart Bik <ajcbik@google.com> Reviewed-by: Alexander Markov <alexmarkov@google.com> Reviewed-by: Martin Kustermann <kustermann@google.com>
42 lines
643 B
Dart
Executable File
42 lines
643 B
Dart
Executable File
// Bug found by DartFuzz (stripped down version):
|
|
// https://github.com/dart-lang/sdk/issues/36076
|
|
|
|
// Code does not do anything, but broke kernel binary flow graph builder.
|
|
|
|
foo() {
|
|
try {
|
|
for (var x in [1, 2]) {
|
|
return;
|
|
}
|
|
} finally {
|
|
for (var x in [3]) {
|
|
break;
|
|
}
|
|
}
|
|
}
|
|
|
|
bar() {
|
|
try {} catch (e) {
|
|
try {} catch (e) {
|
|
for (var x in [1, 2]) {
|
|
if (x == 1) break;
|
|
return;
|
|
}
|
|
try {
|
|
try {} catch (e) {
|
|
return;
|
|
}
|
|
} catch (e) {}
|
|
} finally {
|
|
try {} catch (e) {
|
|
return;
|
|
}
|
|
}
|
|
} finally {}
|
|
}
|
|
|
|
main() {
|
|
foo();
|
|
bar();
|
|
}
|