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

Unified Diff: src/runtime.cc

Issue 6287030: Create specialized code stubs for PixelArray loads. (Closed) Base URL: https://v8.googlecode.com/svn/trunk
Patch Set: cleanup before review Created 9 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
Index: src/runtime.cc
diff --git a/src/runtime.cc b/src/runtime.cc
index b8133ae15e43e3fe08a65114cb60b4c0d8d5300d..6a26f23d5397ea168409eace6dc7b0dcb68fbe4d 100644
--- a/src/runtime.cc
+++ b/src/runtime.cc
@@ -3491,8 +3491,10 @@ static MaybeObject* Runtime_KeyedGetProperty(Arguments args) {
HandleScope scope;
Handle<String> str = args.at<String>(0);
int index = Smi::cast(args[1])->value();
- Handle<Object> result = GetCharAt(str, index);
- return *result;
+ if (index >= 0 && index < str->length()) {
Mads Ager (chromium) 2011/02/01 12:02:12 Good catch! Thanks!
Søren Thygesen Gjesse 2011/02/01 12:02:56 Is this a bug-fix? If so maybe there should be a r
danno 2011/02/03 12:53:26 There's actually an existing test case that wasn't
+ Handle<Object> result = GetCharAt(str, index);
+ return *result;
+ }
}
// Fall back to GetObjectProperty.

Powered by Google App Engine
This is Rietveld 408576698