Mercurial > hg > index.cgi
comparison lwasm/insn_gen.c @ 458:3948c874901b
Make offset,R operand size warning work properly
Make the offset,R operand size check warning work for non-lea operations.
Also exclude offset,W from the check since there is no 8 bit offset.
author | William Astle <lost@l-w.ca> |
---|---|
date | Sat, 17 Feb 2018 00:13:46 -0700 |
parents | b20f14edda5a |
children | 2c1c5dd84024 |
comparison
equal
deleted
inserted
replaced
457:7d6eacd87370 | 458:3948c874901b |
---|---|
286 if (l -> lint == 1) | 286 if (l -> lint == 1) |
287 { | 287 { |
288 if (i < -128 || i > 127) | 288 if (i < -128 || i > 127) |
289 lwasm_register_error(as, l, E_BYTE_OVERFLOW); | 289 lwasm_register_error(as, l, E_BYTE_OVERFLOW); |
290 } | 290 } |
291 else if (l -> lint == 2 && lw_expr_istype(e, lw_expr_type_int) && CURPRAGMA(l, PRAGMA_OPERANDSIZE)) | |
292 { | |
293 if (l -> pb != 0xAF && l -> pb != 0xB0) | |
294 { | |
295 if ((i >= -128 && i <= 127) || i >= 0xFF80) | |
296 { | |
297 lwasm_register_error(as, l, W_OPERAND_SIZE); | |
298 | |
299 } | |
300 } | |
301 } | |
291 lwasm_emitexpr(l, e, l -> lint); | 302 lwasm_emitexpr(l, e, l -> lint); |
292 } | 303 } |
293 | 304 |
294 l -> cycle_adj = lwasm_cycle_calc_ind(l); | 305 l -> cycle_adj = lwasm_cycle_calc_ind(l); |
295 return; | 306 return; |