comparison lwasm/insn_gen.c @ 242:ea092ebc5323

Fix thinko with algorithm improvement. Fix error where DP addressing would be selected by range calculation even when DP addressing is not known to be valid.
author William Astle <lost@l-w.ca>
date Sun, 23 Sep 2012 13:11:34 -0600
parents d0e9dbe9afbe
children 67acad9db5b3
comparison
equal deleted inserted replaced
241:d0e9dbe9afbe 242:ea092ebc5323
131 if ((l -> dpval & 0xff) < min || (l -> dpval & 0xff) > max) 131 if ((l -> dpval & 0xff) < min || (l -> dpval & 0xff) > max)
132 { 132 {
133 l -> lint2 = 2; 133 l -> lint2 = 2;
134 goto out; 134 goto out;
135 } 135 }
136 l -> lint2 = 0; 136 if (min == max && (l -> dpval & 0xff) == min)
137 goto out; 137 {
138 l -> lint2 = 0;
139 goto out;
140 }
141 // if here, we don't know if the value is in the DP or not
142 {
143 l -> lint2 = -1;
144 goto out;
145 }
138 } 146 }
139 } 147 }
140 148
141 out: 149 out:
142 if (l -> lint2 != -1) 150 if (l -> lint2 != -1)
204 if ((l -> dpval & 0xff) < min || (l -> dpval & 0xff) > max) 212 if ((l -> dpval & 0xff) < min || (l -> dpval & 0xff) > max)
205 { 213 {
206 l -> lint2 = 2; 214 l -> lint2 = 2;
207 goto out; 215 goto out;
208 } 216 }
209 l -> lint2 = 0; 217 if (min == max && (l -> dpval & 0xff) == min)
210 goto out; 218 {
219 l -> lint2 = 0;
220 goto out;
221 }
222 // if here, we don't know if the value is in the DP or not
223 {
224 l -> lint2 = -1;
225 goto out;
226 }
211 } 227 }
212 } 228 }
213 229
214 if (force) 230 if (force)
215 { 231 {