Backout Bug 829758 to investigate crashes.

This commit is contained in:
Sean Stangl 2013-01-31 13:51:38 -08:00
parent dbac2df8fb
commit 317b86649c

View File

@ -1900,17 +1900,19 @@ js::str_search(JSContext *cx, unsigned argc, Value *vp)
/* Per ECMAv5 15.5.4.12 (5) The last index property is ignored and left unchanged. */
size_t i = 0;
MatchPair match;
ScopedMatchPairs matches(&cx->tempLifoAlloc());
RegExpRunStatus status = g.regExp().executeMatchOnly(cx, chars, length, &i, match);
RegExpRunStatus status = g.regExp().execute(cx, chars, length, &i, matches);
if (status == RegExpRunStatus_Error)
return false;
if (status == RegExpRunStatus_Success)
res->updateLazily(cx, stableStr, &g.regExp(), 0);
if (status == RegExpRunStatus_Success) {
res->updateFromMatchPairs(cx, stableStr, matches);
args.rval().setInt32(matches[0].start);
} else {
args.rval().setInt32(-1);
}
JS_ASSERT_IF(status == RegExpRunStatus_Success_NotFound, match.start == -1);
args.rval().setInt32(match.start);
return true;
}