comparison lwasm/insn_indexed.c @ 469:9393a6b8886c

Fix PCR size guessing When you want to determine if a value is between two other values, you use *AND*, not OR. Duh.
author William Astle <lost@l-w.ca>
date Sun, 04 Mar 2018 10:24:58 -0700
parents 51bed8c8dc53
children 2c1c5dd84024
comparison
equal deleted inserted replaced
468:7577bfee48bb 469:9393a6b8886c
592 { 592 {
593 v = lw_expr_intval(e2); 593 v = lw_expr_intval(e2);
594 // Actual range is -128 <= offset <= 127; we're allowing a fudge 594 // Actual range is -128 <= offset <= 127; we're allowing a fudge
595 // factor of 25 or so bytes so that we're less likely to accidentally 595 // factor of 25 or so bytes so that we're less likely to accidentally
596 // cross into the 16 bit boundary in weird corner cases. 596 // cross into the 16 bit boundary in weird corner cases.
597 if (v >= -100 || v <= 100) 597 if (v >= -100 && v <= 100)
598 { 598 {
599 l -> lint = 1; 599 l -> lint = 1;
600 l -> pb = (l -> pb & 0x80) ? 0x9C : 0x8C; 600 l -> pb = (l -> pb & 0x80) ? 0x9C : 0x8C;
601 return; 601 return;
602 } 602 }