while(g->g_entryblock && g->g_entryblock->b_iused == 0) {
g->g_entryblock = g->g_entryblock->b_next;
}
+ int next_lbl = get_max_label(g->g_entryblock) + 1;
for (basicblock *b = g->g_entryblock; b != NULL; b = b->b_next) {
assert(b->b_iused > 0);
for (int i = 0; i < b->b_iused; i++) {
while (target->b_iused == 0) {
target = target->b_next;
}
- instr->i_target = target;
+ if (instr->i_target != target) {
+ if (!IS_LABEL(target->b_label)) {
+ target->b_label.id = next_lbl++;
+ }
+ instr->i_target = target;
+ instr->i_oparg = target->b_label.id;
+ }
assert(instr->i_target && instr->i_target->b_iused > 0);
}
}