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

[regexp] Ensure handles are freed inside RegExpReplace loop

Handles created inside each loop iteration should be freed as the
current iteration goes out of scope.

TBR=yangguo@chromium.org

Bug: v8:7122, chromium:763839
Change-Id: I70a95457c773b26792d87734dab62bc8f4f5fbd0
Reviewed-on: https://chromium-review.googlesource.com/796794Reviewed-by: 's avatarJakob Gruber <jgruber@chromium.org>
Commit-Queue: Jakob Gruber <jgruber@chromium.org>
Cr-Commit-Position: refs/heads/master@{#49737}
parent a812ecdc
......@@ -1804,6 +1804,7 @@ RUNTIME_FUNCTION(Runtime_RegExpReplace) {
uint32_t next_source_position = 0;
for (const auto& result : results) {
HandleScope handle_scope(isolate);
Handle<Object> captures_length_obj;
ASSIGN_RETURN_FAILURE_ON_EXCEPTION(
isolate, captures_length_obj,
......
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