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 *state
|
||||||
= (struct constpool_parser_state *)asm_parser_get_state(ctx);
|
= (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;
|
state->s_prev_token = IVY_ASM_TOK_LINEFEED;
|
||||||
|
|
||||||
@@ -49,8 +48,6 @@ static enum ivy_status parse_linefeed(
|
|||||||
return status;
|
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);
|
ivy_ident_destroy(state->s_base.s_previous_value);
|
||||||
break;
|
break;
|
||||||
case IVY_ASM_PVAL_ATOM:
|
case IVY_ASM_PVAL_ATOM:
|
||||||
@@ -62,19 +59,25 @@ static enum ivy_status parse_linefeed(
|
|||||||
return status;
|
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);
|
ivy_asm_token_destroy(tmp);
|
||||||
break;
|
break;
|
||||||
case IVY_ASM_PVAL_SINT:
|
case IVY_ASM_PVAL_SINT:
|
||||||
entry.e_type = b_i32_htob(IVY_CONSTPOOL_TABLE_INT);
|
status = ivy_assembler_put_pval(
|
||||||
entry.e_int = b_i32_htob(
|
ctx->p_assembler, IVY_ASM_PVAL_SINT, state->s_current_index,
|
||||||
(uint32_t)state->s_current_pval_val.tok->t_int.v);
|
&state->s_current_pval_val.tok->t_int.v, &key);
|
||||||
|
if (status != IVY_OK) {
|
||||||
|
return status;
|
||||||
|
}
|
||||||
|
|
||||||
break;
|
break;
|
||||||
case IVY_ASM_PVAL_UINT:
|
case IVY_ASM_PVAL_UINT:
|
||||||
entry.e_type = b_i32_htob(IVY_CONSTPOOL_TABLE_UINT);
|
status = ivy_assembler_put_pval(
|
||||||
entry.e_int = b_i32_htob(
|
ctx->p_assembler, IVY_ASM_PVAL_UINT, state->s_current_index,
|
||||||
(uint32_t)state->s_current_pval_val.tok->t_int.uv);
|
&state->s_current_pval_val.tok->t_int.uv, &key);
|
||||||
|
if (status != IVY_OK) {
|
||||||
|
return status;
|
||||||
|
}
|
||||||
|
|
||||||
break;
|
break;
|
||||||
case IVY_ASM_PVAL_SELECTOR:
|
case IVY_ASM_PVAL_SELECTOR:
|
||||||
status = ivy_assembler_put_pval(
|
status = ivy_assembler_put_pval(
|
||||||
@@ -85,8 +88,6 @@ static enum ivy_status parse_linefeed(
|
|||||||
return status;
|
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);
|
ivy_selector_destroy(state->s_base.s_previous_value);
|
||||||
break;
|
break;
|
||||||
case IVY_ASM_PVAL_STRING:
|
case IVY_ASM_PVAL_STRING:
|
||||||
@@ -98,8 +99,6 @@ static enum ivy_status parse_linefeed(
|
|||||||
return status;
|
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);
|
ivy_asm_token_destroy(tmp);
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
|
|||||||
Reference in New Issue
Block a user