Fix some missed branch/goto expression changes.

This commit is contained in:
Bill Currie 2011-03-03 17:33:53 +09:00
parent c5ecc170b6
commit b5e7e666e9
2 changed files with 5 additions and 2 deletions

View file

@ -1014,6 +1014,8 @@ backpatch (ex_list_t *list, expr_t *label)
if (!list)
return;
if (!label || label->type != ex_label)
internal_error (label, "not a label");
for (i = 0; i < list->size; i++) {
e = list->e[i];
@ -1025,6 +1027,7 @@ backpatch (ex_list_t *list, expr_t *label)
else {
internal_error (e, 0);
}
label->e.label.used++;
}
}

View file

@ -293,7 +293,7 @@ build_switch (expr_t *sw, case_node_t *tree, int op, expr_t *sw_val,
append_expr (sw, branch);
if (tree->left) {
branch = new_binary_expr (IFA, temp, high_label);
branch = branch_expr (IFA, temp, high_label);
append_expr (sw, branch);
build_switch (sw, tree->left, op, sw_val, temp, default_label);
@ -321,7 +321,7 @@ build_switch (expr_t *sw, case_node_t *tree, int op, expr_t *sw_val,
table = new_symbol_expr (sym);
if (tree->left) {
branch = new_binary_expr (IFB, temp, low_label);
branch = branch_expr (IFB, temp, low_label);
append_expr (sw, branch);
}
//FIXME unsigned int