Commit e97c48ec authored by Jakob Gruber's avatar Jakob Gruber Committed by Commit Bot

[regexp] Again support regexp execution without side effects

This is a quirk needed for the regexp fuzzer, which passes its own
custom RegExpMatchInfo object to RegExpImpl::Exec and expects execution
without side effects.

Bug: chromium:934621
Change-Id: I90286fda06593d7c574d8d4629481ebad2fa5b1d
Reviewed-on: https://chromium-review.googlesource.com/c/1485833Reviewed-by: 's avatarPeter Marshall <petermarshall@chromium.org>
Commit-Queue: Jakob Gruber <jgruber@chromium.org>
Cr-Commit-Position: refs/heads/master@{#59839}
parent b6c0c447
......@@ -564,8 +564,13 @@ Handle<RegExpMatchInfo> RegExpImpl::SetLastMatchInfo(
result->SetNumberOfCaptureRegisters(capture_register_count);
if (*result != *last_match_info) {
DCHECK_EQ(*last_match_info, *isolate->regexp_last_match_info());
isolate->native_context()->set_regexp_last_match_info(*result);
if (*last_match_info == *isolate->regexp_last_match_info()) {
// This inner condition is only needed for special situations like the
// regexp fuzzer, where we pass our own custom RegExpMatchInfo to
// RegExpImpl::Exec; there actually want to bypass the Isolate's match
// info and execute the regexp without side effects.
isolate->native_context()->set_regexp_last_match_info(*result);
}
}
DisallowHeapAllocation no_allocation;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment