CHECK_BB(emit_exp(emit, e, 0))
*instr = emit_add_instr(emit, SwitchIni);
(*instr)->m_val = (m_uint)switch_vec(emit->env);
+ } else {
+ const Instr instr = emit_add_instr(emit, RegPushImm);
+ instr->m_val = (m_uint)switch_map(emit->env);
}
return GW_OK;
}
}
INSTR(BranchSwitch) { GWDEBUG_EXE
- const m_uint offset = *(m_uint*)instr->ptr;
- POP_REG(shred, SZ_INT + offset);
- const Map map = !offset ?(Map)instr->m_val2 : *(Map*)REG(0);
- shred->pc = map_get(map, *(m_uint*)REG(offset));
+ POP_REG(shred, SZ_INT*2);
+ const Map map = *(Map*)REG(0);
+ shred->pc = map_get(map, *(m_uint*)REG(SZ_INT));
if(!shred->pc)
shred->pc = instr->m_val;
}