From 40bbb6dcc2863b440484d090f5ae09d14ea90865 Mon Sep 17 00:00:00 2001 From: Daco Harkes Date: Tue, 7 Sep 2021 15:47:22 +0000 Subject: [PATCH] [vm] Const map, remove invalid assert Isolates are allowed to race each other to initialize _indexNullable, the last isolate wins. See https://dart-review.googlesource.com/c/sdk/+/210726 and https://dart-review.googlesource.com/c/sdk/+/203765. These asserts were wrong, because another isolate could have initialized _indexNullable in between places calling _createIndex and _createIndex itself. Closes: https://github.com/dart-lang/sdk/issues/47118 Change-Id: I5d55b9715ef622737a6f70c0b57590076ece3225 Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/212586 Reviewed-by: Martin Kustermann Commit-Queue: Daco Harkes --- sdk/lib/_internal/vm/lib/compact_hash.dart | 4 ---- 1 file changed, 4 deletions(-) diff --git a/sdk/lib/_internal/vm/lib/compact_hash.dart b/sdk/lib/_internal/vm/lib/compact_hash.dart index 29c57e750d7..abd8baa8b5d 100644 --- a/sdk/lib/_internal/vm/lib/compact_hash.dart +++ b/sdk/lib/_internal/vm/lib/compact_hash.dart @@ -248,8 +248,6 @@ class _InternalImmutableLinkedHashMap extends _HashVMImmutableBase } void _createIndex() { - assert(_indexNullable == null); - final size = max(_data.length, _HashBase._INITIAL_INDEX_SIZE); assert(size == _roundUpToPowerOfTwo(size)); final newIndex = new Uint32List(size); @@ -827,8 +825,6 @@ class _CompactImmutableLinkedHashSet extends _HashVMImmutableBase } void _createIndex() { - assert(_indexNullable == null); - final size = _roundUpToPowerOfTwo( max(_data.length * 2, _HashBase._INITIAL_INDEX_SIZE)); final index = new Uint32List(size);