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

Unified Diff: frog/gen.dart

Issue 9129023: adds array bounds checking (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: merged Created 8 years, 11 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 | « frog/frog_options.dart ('k') | frog/lib/corelib_impl.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: frog/gen.dart
diff --git a/frog/gen.dart b/frog/gen.dart
index 56e2f87dcdec57104e6ecde2b1f72e462a4f967e..418cba321271f4b313a7620ae2b5ef8a5c7680da 100644
--- a/frog/gen.dart
+++ b/frog/gen.dart
@@ -73,6 +73,14 @@ class WorldGenerator {
world.numImplType.markUsed();
world.stringImplType.markUsed();
+ if (corejs.useIndex || corejs.useSetIndex) {
+ if (!options.disableBoundsChecks) {
+ // These exceptions might be thrown by array bounds checks.
+ markTypeUsed(world.corelib.types['IndexOutOfRangeException']);
+ markTypeUsed(world.corelib.types['IllegalArgumentException']);
+ }
+ }
+
// Only include isolate-specific code if isolates are used.
if (world.corelib.types['Isolate'].isUsed
|| world.coreimpl.types['ReceivePortImpl'].isUsed) {
« no previous file with comments | « frog/frog_options.dart ('k') | frog/lib/corelib_impl.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698