From 5b9a6deb93acf180645cfcff13f0e6c425c969ac Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?D=C3=A1niel=20B=C3=A1tyai?= Date: Thu, 8 Oct 2020 10:02:43 +0200 Subject: [PATCH] Replace fast path should keep a reference to the executed bytecode (#4277) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit JerryScript-DCO-1.0-Signed-off-by: Dániel Bátyai daniel.batyai@h-lab.eu --- jerry-core/ecma/operations/ecma-regexp-object.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/jerry-core/ecma/operations/ecma-regexp-object.c b/jerry-core/ecma/operations/ecma-regexp-object.c index 42db85b22..9d8459366 100644 --- a/jerry-core/ecma/operations/ecma-regexp-object.c +++ b/jerry-core/ecma/operations/ecma-regexp-object.c @@ -2615,6 +2615,7 @@ ecma_regexp_replace_helper_fast (ecma_replace_context_t *ctx_p, /**u.class_prop.u.value); + ecma_bytecode_ref ((ecma_compiled_code_t *) bc_p); JERRY_ASSERT (bc_p != NULL); ecma_value_t result = ECMA_VALUE_EMPTY; @@ -2850,6 +2851,7 @@ cleanup_builder: cleanup_context: ecma_regexp_cleanup_context (&re_ctx); + ecma_bytecode_deref ((ecma_compiled_code_t *) bc_p); if (string_flags & ECMA_STRING_FLAG_MUST_BE_FREED) {