Fix fast jit destroy block issue (#1412)

Only destroy the block if it hasn't been pushed into the block stack,
or it will be destroyed again when destroying the block stack.
This commit is contained in:
Wenyong Huang 2022-08-24 22:00:16 +08:00 committed by GitHub
parent ebcbe0b571
commit 903a27aff2
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -807,7 +807,11 @@ jit_compile_op_block(JitCompContext *cc, uint8 **p_frame_ip,
return true;
fail:
jit_block_destroy(block);
/* Only destroy the block if it hasn't been pushed into
the block stack, or if will be destroyed again when
destroying the block stack */
if (jit_block_stack_top(&cc->block_stack) != block)
jit_block_destroy(block);
return false;
}