|
|
@@ -380,17 +380,12 @@ jit_cc_init(JitCompContext *cc, unsigned htab_size)
|
|
|
|
|
|
/* Create entry and exit blocks. They must be the first two
|
|
|
blocks respectively. */
|
|
|
- if (!(entry_block = jit_cc_new_basic_block(cc, 0))
|
|
|
- || !(exit_block = jit_cc_new_basic_block(cc, 0)))
|
|
|
+ if (!(entry_block = jit_cc_new_basic_block(cc, 0)))
|
|
|
goto fail;
|
|
|
-
|
|
|
- if (!(cc->exce_basic_blocks =
|
|
|
- jit_calloc(sizeof(JitBasicBlock *) * JIT_EXCE_NUM)))
|
|
|
- goto fail;
|
|
|
-
|
|
|
- if (!(cc->incoming_insns_for_exec_bbs =
|
|
|
- jit_calloc(sizeof(JitIncomingInsnList) * JIT_EXCE_NUM)))
|
|
|
+ if (!(exit_block = jit_cc_new_basic_block(cc, 0))) {
|
|
|
+ jit_basic_block_delete(entry_block);
|
|
|
goto fail;
|
|
|
+ }
|
|
|
|
|
|
/* Record the entry and exit labels, whose indexes must be 0 and 1
|
|
|
respectively. */
|
|
|
@@ -399,6 +394,14 @@ jit_cc_init(JitCompContext *cc, unsigned htab_size)
|
|
|
bh_assert(jit_reg_no(cc->entry_label) == 0
|
|
|
&& jit_reg_no(cc->exit_label) == 1);
|
|
|
|
|
|
+ if (!(cc->exce_basic_blocks =
|
|
|
+ jit_calloc(sizeof(JitBasicBlock *) * JIT_EXCE_NUM)))
|
|
|
+ goto fail;
|
|
|
+
|
|
|
+ if (!(cc->incoming_insns_for_exec_bbs =
|
|
|
+ jit_calloc(sizeof(JitIncomingInsnList) * JIT_EXCE_NUM)))
|
|
|
+ goto fail;
|
|
|
+
|
|
|
cc->hreg_info = jit_codegen_get_hreg_info();
|
|
|
bh_assert(cc->hreg_info->info[JIT_REG_KIND_I32].num > 3);
|
|
|
|