asm: parse: fix parse_linefeed not writing constpool entries for int/uint values
This commit is contained in:
@@ -26,7 +26,6 @@ static enum ivy_status parse_linefeed(
|
||||
{
|
||||
struct constpool_parser_state *state
|
||||
= (struct constpool_parser_state *)asm_parser_get_state(ctx);
|
||||
struct ivy_bin_constpool_table_entry entry = {0};
|
||||
|
||||
state->s_prev_token = IVY_ASM_TOK_LINEFEED;
|
||||
|
||||
@@ -49,8 +48,6 @@ static enum ivy_status parse_linefeed(
|
||||
return status;
|
||||
}
|
||||
|
||||
entry.e_type = b_i32_htob(IVY_CONSTPOOL_TABLE_IDENT);
|
||||
entry.e_ex_handle = b_i32_htob(key);
|
||||
ivy_ident_destroy(state->s_base.s_previous_value);
|
||||
break;
|
||||
case IVY_ASM_PVAL_ATOM:
|
||||
@@ -62,19 +59,25 @@ static enum ivy_status parse_linefeed(
|
||||
return status;
|
||||
}
|
||||
|
||||
entry.e_type = b_i32_htob(IVY_CONSTPOOL_TABLE_ATOM);
|
||||
entry.e_ex_handle = b_i32_htob(key);
|
||||
ivy_asm_token_destroy(tmp);
|
||||
break;
|
||||
case IVY_ASM_PVAL_SINT:
|
||||
entry.e_type = b_i32_htob(IVY_CONSTPOOL_TABLE_INT);
|
||||
entry.e_int = b_i32_htob(
|
||||
(uint32_t)state->s_current_pval_val.tok->t_int.v);
|
||||
status = ivy_assembler_put_pval(
|
||||
ctx->p_assembler, IVY_ASM_PVAL_SINT, state->s_current_index,
|
||||
&state->s_current_pval_val.tok->t_int.v, &key);
|
||||
if (status != IVY_OK) {
|
||||
return status;
|
||||
}
|
||||
|
||||
break;
|
||||
case IVY_ASM_PVAL_UINT:
|
||||
entry.e_type = b_i32_htob(IVY_CONSTPOOL_TABLE_UINT);
|
||||
entry.e_int = b_i32_htob(
|
||||
(uint32_t)state->s_current_pval_val.tok->t_int.uv);
|
||||
status = ivy_assembler_put_pval(
|
||||
ctx->p_assembler, IVY_ASM_PVAL_UINT, state->s_current_index,
|
||||
&state->s_current_pval_val.tok->t_int.uv, &key);
|
||||
if (status != IVY_OK) {
|
||||
return status;
|
||||
}
|
||||
|
||||
break;
|
||||
case IVY_ASM_PVAL_SELECTOR:
|
||||
status = ivy_assembler_put_pval(
|
||||
@@ -85,8 +88,6 @@ static enum ivy_status parse_linefeed(
|
||||
return status;
|
||||
}
|
||||
|
||||
entry.e_type = b_i32_htob(IVY_CONSTPOOL_TABLE_SELECTOR);
|
||||
entry.e_ex_handle = b_i32_htob(key);
|
||||
ivy_selector_destroy(state->s_base.s_previous_value);
|
||||
break;
|
||||
case IVY_ASM_PVAL_STRING:
|
||||
@@ -98,8 +99,6 @@ static enum ivy_status parse_linefeed(
|
||||
return status;
|
||||
}
|
||||
|
||||
entry.e_type = b_i32_htob(IVY_CONSTPOOL_TABLE_STRING);
|
||||
entry.e_ex_handle = b_i32_htob(key);
|
||||
ivy_asm_token_destroy(tmp);
|
||||
break;
|
||||
default:
|
||||
|
||||
Reference in New Issue
Block a user