-
Notifications
You must be signed in to change notification settings - Fork 1.7k
Closed
Labels
area-vmUse area-vm for VM related issues, including code coverage, and the AOT and JIT backends.Use area-vm for VM related issues, including code coverage, and the AOT and JIT backends.library-core
Description
This program crashes on VM but not other platforms:
main() {
var a = [];
a.addAll(a);
}Crash:
Unhandled exception:
Concurrent modification during iteration: Instance(length:0) of '_GrowableList'.
#0 List.addAll (dart:core-patch/growable_array.dart:191:11)
#1 main (file://bug1b5g.dart:3:5)
#2 _startIsolate.<anonymous closure> (dart:isolate-patch/isolate_patch.dart:301:19)
DDC and dart2js only check for an unexpected length just after obtaining the element provided by the iterator.
This works on the VM which indicates that the _GrowableList.addAll(_GrowableList) path is incorrectly specialized:
import 'dart:collection';
main() {
var a = [];
a.addAll(UnmodifiableListView(a));
}Metadata
Metadata
Assignees
Labels
area-vmUse area-vm for VM related issues, including code coverage, and the AOT and JIT backends.Use area-vm for VM related issues, including code coverage, and the AOT and JIT backends.library-core