Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(907)

Issue 14468004: Fix missing concurrency check in [].forEach. (Closed)

Created:
7 years, 8 months ago by Lasse Reichstein Nielsen
Modified:
7 years, 8 months ago
CC:
reviews_dartlang.org, regis
Visibility:
Public.

Description

Fix missing concurrency check in [].forEach. Also fix a bad range check for List.setRange. Added more tests. BUG=http://dartbug.com/10045 Committed: https://code.google.com/p/dart/source/detail?r=21935

Patch Set 1 #

Total comments: 4

Patch Set 2 : Added comment about iteration order of lists. #

Total comments: 3
Unified diffs Side-by-side diffs Delta from patch set Stats (+178 lines, -13 lines) Patch
M runtime/lib/array.dart View 1 chunk +1 line, -1 line 0 comments Download
M runtime/lib/growable_array.dart View 1 chunk +2 lines, -2 lines 2 comments Download
M runtime/lib/typeddata.dart View 1 chunk +2 lines, -2 lines 0 comments Download
M sdk/lib/core/list.dart View 1 1 chunk +12 lines, -0 lines 1 comment Download
M tests/corelib/list_test.dart View 6 chunks +161 lines, -8 lines 0 comments Download

Messages

Total messages: 6 (0 generated)
Lasse Reichstein Nielsen
7 years, 8 months ago (2013-04-24 08:52:35 UTC) #1
Søren Gjesse
lgtm https://codereview.chromium.org/14468004/diff/1/runtime/lib/typeddata.dart File runtime/lib/typeddata.dart (right): https://codereview.chromium.org/14468004/diff/1/runtime/lib/typeddata.dart#newcode463 runtime/lib/typeddata.dart:463: Is it documented in toList that the default ...
7 years, 8 months ago (2013-04-24 09:00:49 UTC) #2
Lasse Reichstein Nielsen
https://codereview.chromium.org/14468004/diff/1/runtime/lib/typeddata.dart File runtime/lib/typeddata.dart (right): https://codereview.chromium.org/14468004/diff/1/runtime/lib/typeddata.dart#newcode463 runtime/lib/typeddata.dart:463: Yes. It's defined the same way on Iterable, so ...
7 years, 8 months ago (2013-04-24 09:30:57 UTC) #3
Lasse Reichstein Nielsen
Committed patchset #2 manually as r21935 (presubmit successful).
7 years, 8 months ago (2013-04-24 09:34:27 UTC) #4
hausner
DBC https://codereview.chromium.org/14468004/diff/7001/runtime/lib/growable_array.dart File runtime/lib/growable_array.dart (right): https://codereview.chromium.org/14468004/diff/7001/runtime/lib/growable_array.dart#newcode244 runtime/lib/growable_array.dart:244: if (length != initialLength) throw new ConcurrentModificationError(this); This ...
7 years, 8 months ago (2013-04-25 23:07:17 UTC) #5
Ivan Posva
7 years, 8 months ago (2013-04-26 05:58:22 UTC) #6
Message was sent while issue was closed.
https://codereview.chromium.org/14468004/diff/7001/runtime/lib/growable_array...
File runtime/lib/growable_array.dart (right):

https://codereview.chromium.org/14468004/diff/7001/runtime/lib/growable_array...
runtime/lib/growable_array.dart:244: if (length != initialLength) throw new
ConcurrentModificationError(this);
On 2013/04/25 23:07:17, hausner wrote:
> This is not sufficient to detect modifications. The mutator could remove one
> element and add one. That would go undetected with this check.
> 
> I think you need a counter in the array that gets incremented each time the
list
> is modified. Whether it is worth paying the price for detecting this is
another
> question.
> 

I think the only concern is that length could change. Basically if you asked for
the length of this List, you'd expect that forEach is called the same number of
times.

Powered by Google App Engine
This is Rietveld 408576698