Index: runtime/lib/regexp_jsc.cc |
diff --git a/runtime/lib/regexp_jsc.cc b/runtime/lib/regexp_jsc.cc |
index 0066aa7cc5457cac31d25ecc4846878c38d34400..5b34d159d9d67eda519e6cf4d313ff6b506e4d22 100644 |
--- a/runtime/lib/regexp_jsc.cc |
+++ b/runtime/lib/regexp_jsc.cc |
@@ -156,13 +156,11 @@ RawArray* Jscre::Execute(const JSRegExp& regex, |
const int kMatchPair = 2; |
siva
2012/03/19 18:29:14
ASSERT(retval <= (num_bracket_expressions + 1));
|
Array& array = |
- Array::Handle(Array::New(kMatchPair * (num_bracket_expressions + 1))); |
+ Array::Handle(Array::New(kMatchPair * retval)); |
// The matches come in (start, end + 1) pairs for each bracketted expression. |
Smi& start = Smi::Handle(); |
Smi& end = Smi::Handle(); |
- for (intptr_t i = 0; |
- i < (kMatchPair * (num_bracket_expressions + 1)); |
- i += kMatchPair) { |
+ for (intptr_t i = 0; i < (kMatchPair * retval); i += kMatchPair) { |
start = Smi::New(offsets[i]); |
end = Smi::New(offsets[i + 1]); |
array.SetAt(i, start); |