Replace fast path should keep a reference to the executed bytecode (#4277)

JerryScript-DCO-1.0-Signed-off-by: Dániel Bátyai daniel.batyai@h-lab.eu
This commit is contained in:
Dániel Bátyai
2020-10-08 10:02:43 +02:00
committed by GitHub
parent 4df833e7ad
commit 5b9a6deb93
@@ -2615,6 +2615,7 @@ ecma_regexp_replace_helper_fast (ecma_replace_context_t *ctx_p, /**<replace cont
{
const re_compiled_code_t *bc_p = ECMA_GET_INTERNAL_VALUE_POINTER (re_compiled_code_t,
re_obj_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)
{