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. |