comparison lwasm/insn_rel.c @ 455:cad5937314cb

Add operandsizewarning pragma Add operandsizewarning pragma that will raise warnings for certain operands if the operand size could be smaller. (Long branch used instead of short branch, for instance.)
author William Astle <lost@l-w.ca>
date Fri, 16 Feb 2018 22:53:46 -0700
parents 0af33282b518
children
comparison
equal deleted inserted replaced
454:ffdef8994f13 455:cad5937314cb
312 } 312 }
313 else 313 else
314 { 314 {
315 lwasm_emitop(l, instab[l -> insn].ops[3]); 315 lwasm_emitop(l, instab[l -> insn].ops[3]);
316 lwasm_emitexpr(l, e, 2); 316 lwasm_emitexpr(l, e, 2);
317 317 if (CURPRAGMA(l, PRAGMA_OPERANDSIZE) && lw_expr_istype(e, lw_expr_type_int))
318 {
319 offs = lw_expr_intval(e);
320 if (offs >= -128 && offs <= 127)
321 {
322 lwasm_register_error(as, l, W_OPERAND_SIZE);
323 }
324 }
318 } 325 }
319 } 326 }