tests passing

This commit is contained in:
caheckman 2019-06-16 23:42:48 -04:00
parent f825b1aa57
commit e5c7b58305
2 changed files with 11 additions and 5 deletions

View file

@ -631,6 +631,11 @@ void LoadGuard::finalizeRange(const ValueSetRead &valueSet)
analysisState = 1; // In all cases the settings determined here are final
const CircleRange &range( valueSet.getRange() );
uintb rangeSize = range.getSize();
if (rangeSize == 0x100 || rangeSize == 0x10000) {
// These sizes likely result from the storage size of the index
if (step == 0) // If we didn't see signs of iteration
rangeSize = 0; // don't use this range
}
if (rangeSize > 1 && rangeSize < 0xffffff) { // Did we converge to something reasonable
analysisState = 2; // Mark that we got a definitive result
if (rangeSize > 2)

View file

@ -1098,8 +1098,8 @@ bool CircleRange::pushForwardUnary(OpCode opc,const CircleRange &in1,int4 inSize
left = in1.left;
right = (in1.right - in1.step) & in1.mask;
if (right < left) { // Extending causes 2 pieces
left = 0;
right = in1.mask;
left = left % step;
right = in1.mask + 1 + left;
}
else {
right += step; // Impossible for it to wrap with bigger mask
@ -1112,9 +1112,10 @@ bool CircleRange::pushForwardUnary(OpCode opc,const CircleRange &in1,int4 inSize
left = sign_extend(in1.left, inSize, outSize);
right = sign_extend((in1.right - in1.step)&in1.mask, inSize, outSize);
if ((intb)right < (intb)left) {
right = calc_mask(inSize);
left = calc_mask(outSize) ^ right;
right += 1;
uintb rem = left % step;
right = calc_mask(inSize) >> 1;
left = (calc_mask(outSize) ^ right) + rem;
right = right + 1 + rem;
}
else
right += step;