# HG changeset patch # User lost@l-w.ca # Date 1313125107 21600 # Node ID f2f3a4b0a25e79f612339b40ee4728191b415de0 # Parent 50d86baf4ea21f8784105c1658a72d154f3fe004 Fix fix for forced index offset sizes diff -r 50d86baf4ea2 -r f2f3a4b0a25e lwasm/insn_indexed.c --- a/lwasm/insn_indexed.c Thu Aug 11 22:48:16 2011 -0600 +++ b/lwasm/insn_indexed.c Thu Aug 11 22:58:27 2011 -0600 @@ -236,12 +236,13 @@ if (l -> lint == 1) { l -> pb = 0x88 | (rn << 5) | (indir ? 0x10 : 0); + return; } else if (l -> lint == 2) { l -> pb = 0x89 | (rn << 5) | (indir ? 0x10 : 0); + return; } - return; } // nnnn,W is only 16 bit (or 0 bit) @@ -337,7 +338,7 @@ if (l -> len != -1) return; - + e = lwasm_fetch_expr(l, 0); if (!lw_expr_istype(e, lw_expr_type_int)) { @@ -438,7 +439,7 @@ } else { - // we have X,Y,U,S and a possible 16 bit here + // we have X,Y,U,S and a possible 5 bit here l -> lint = 0; if (v == 0 && !(CURPRAGMA(l, PRAGMA_NOINDEX0TONONE) || l -> pb & 0x40)) @@ -447,7 +448,7 @@ } else { - pb = (l -> pb & 0x03) << 5 | (v & 0x1F); + pb = ((l -> pb & 0x03) << 5) | (v & 0x1F); } l -> pb = pb; lw_expr_destroy(e2); @@ -539,7 +540,7 @@ } else { - // we have X,Y,U,S and a possible 16 bit here + // we have X,Y,U,S and a possible 5 bit here l -> lint = 0; if (v == 0 && !(CURPRAGMA(l, PRAGMA_NOINDEX0TONONE) || l -> pb & 0x40)) @@ -548,7 +549,7 @@ } else { - pb = (l -> pb & 0x03) << 5 | (v & 0x1F); + pb = ((l -> pb & 0x03) << 5) | (v & 0x1F); } l -> pb = pb; return;