Skip to content

Commit 903a27a

Browse files
authored
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.
1 parent ebcbe0b commit 903a27a

1 file changed

Lines changed: 5 additions & 1 deletion

File tree

core/iwasm/fast-jit/fe/jit_emit_control.c

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -807,7 +807,11 @@ jit_compile_op_block(JitCompContext *cc, uint8 **p_frame_ip,
807807

808808
return true;
809809
fail:
810-
jit_block_destroy(block);
810+
/* Only destroy the block if it hasn't been pushed into
811+
the block stack, or if will be destroyed again when
812+
destroying the block stack */
813+
if (jit_block_stack_top(&cc->block_stack) != block)
814+
jit_block_destroy(block);
811815
return false;
812816
}
813817

0 commit comments

Comments
 (0)