mirror of
https://git.code.sf.net/p/quake/quakeforge
synced 2024-11-26 22:31:05 +00:00
Fix jumpb's operand types.
Aliasing the jump table to an integer broke statement_get_targetlist with the new alias def handling, and was really wrong anyway. I probably did that due to being fed up with things and wanting to get qfcc working again rather than spending time getting jumpb right.
This commit is contained in:
parent
c06cd8fcc0
commit
34e3ac1468
3 changed files with 3 additions and 2 deletions
|
@ -847,7 +847,7 @@ VISIBLE opcode_t pr_opcodes[] = {
|
|||
"%Ga",
|
||||
},
|
||||
{"<JUMPB>", "jumpb", OP_JUMPB, false,
|
||||
ev_integer, ev_integer, ev_invalid,
|
||||
ev_void, ev_integer, ev_invalid,
|
||||
PROG_VERSION,
|
||||
"%Ga[%Gb]",
|
||||
},
|
||||
|
|
|
@ -418,6 +418,8 @@ statement_get_targetlist (statement_t *s)
|
|||
} else if (statement_is_goto (s)) {
|
||||
target_list[0] = statement_get_target (s);
|
||||
} else if (statement_is_jumpb (s)) {
|
||||
if (table->alias)
|
||||
internal_error (0, "aliased jump table");
|
||||
e = table->initializer->e.block.head; //FIXME check!!!
|
||||
for (i = 0; i < count; e = e->next, i++)
|
||||
target_list[i] = e->e.labelref.label->dest;
|
||||
|
|
|
@ -345,7 +345,6 @@ build_switch (expr_t *sw, case_node_t *tree, int op, expr_t *sw_val,
|
|||
initialize_def (table_sym, array_type (&type_integer, high - low + 1),
|
||||
table_init, pr.near_data, sc_static);
|
||||
table_expr = new_symbol_expr (table_sym);
|
||||
table_expr = new_alias_expr (&type_integer, table_expr);
|
||||
|
||||
if (tree->left) {
|
||||
branch = branch_expr (IFB, temp, low_label);
|
||||
|
|
Loading…
Reference in a new issue