fixed casetbl not being aligned correctly

fixed bitshifting the wrong way (oops!)

--HG--
extra : convert_revision : svn%3A39bc706e-5318-0410-9160-8a85361fbb7c/trunk%40113
This commit is contained in:
David Anderson 2006-10-10 17:22:28 +00:00
parent f62af67279
commit 9bc1279af1

View File

@ -1280,7 +1280,7 @@ inline void WriteOp_JsGeq(JitWriter *jit)
inline void WriteOp_Switch(JitWriter *jit)
{
cell_t offs = jit->read_cell();
cell_t *tbl = (cell_t *)((char *)jit->inbase + offs);
cell_t *tbl = (cell_t *)((char *)jit->inbase + offs + sizeof(cell_t));
struct casetbl
{
@ -1348,9 +1348,9 @@ inline void WriteOp_Switch(JitWriter *jit)
* ECX still has the correctly bound offset in it, luckily!
* thus, we simply need to relocate ECX and store the cases.
*/
//shr ecx, 2
//shl ecx, 2
//add ecx, <case table start>
IA32_Shr_Rm_Imm8(jit, AMX_REG_TMP, 2, MOD_REG);
IA32_Shl_Rm_Imm8(jit, AMX_REG_TMP, 2, MOD_REG);
jitoffs_t tbl_offs = IA32_Add_Rm_Imm32_Later(jit, AMX_REG_TMP, MOD_REG);
IA32_Jump_Rm(jit, AMX_REG_TMP, MOD_MEM_REG);
/* The case table starts here. Go back and write the output pointer. */