diff lwasm/insn_indexed.c @ 463:42be9eec7935

Make pcr relative forward references better able to select 8 bit offsets
author William Astle <lost@l-w.ca>
date Wed, 28 Feb 2018 23:00:59 -0700
parents 3948c874901b
children 9134f6426c57
line wrap: on
line diff
--- a/lwasm/insn_indexed.c	Wed Feb 28 22:40:07 2018 -0700
+++ b/lwasm/insn_indexed.c	Wed Feb 28 23:00:59 2018 -0700
@@ -469,6 +469,13 @@
 //		e3 = lw_expr_copy(e);
 //		lwasm_reduce_expr(as, e3);
 		l -> len = -1;
+		if (!lw_expr_istype(e2, lw_expr_type_int))
+		{
+			v = as -> pretendmax;
+			as -> pretendmax = 1;
+			lwasm_reduce_expr(as, e2);
+			as -> pretendmax = v;
+		}
 		if (lw_expr_istype(e2, lw_expr_type_int))
 		{
 			v = lw_expr_intval(e2);