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

Unified Diff: sdk/lib/typed_data/dart2js/native_typed_data_dart2js.dart

Issue 174663002: Tighten dart2js typed_data range check (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 6 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: sdk/lib/typed_data/dart2js/native_typed_data_dart2js.dart
diff --git a/sdk/lib/typed_data/dart2js/native_typed_data_dart2js.dart b/sdk/lib/typed_data/dart2js/native_typed_data_dart2js.dart
index 17a61b65e77a51285b63a7536b6674c27694aee3..efc4957196584465b59791f1116544c1b9e1514c 100644
--- a/sdk/lib/typed_data/dart2js/native_typed_data_dart2js.dart
+++ b/sdk/lib/typed_data/dart2js/native_typed_data_dart2js.dart
@@ -79,7 +79,8 @@ class NativeTypedData implements TypedData native "ArrayBufferView" {
}
void _checkIndex(int index, int length) {
- if (JS('bool', '(# >>> 0 != #)', index, index) || index >= length) {
+ if (JS('bool', '(# >>> 0) !== #', index, index) ||
+ JS('int', '#', index) >= length) { // 'int' guaranteed by above test.
_invalidIndex(index, length);
}
}
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698