Skip to content

Commit 2f66f5a

Browse files
authored
Merge pull request #158 from jad-hamza/bitset-fix2
When shifting right, only add ones for signed bitvectors
2 parents a17599d + 8773ca5 commit 2f66f5a

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/main/scala/inox/evaluators/RecursiveEvaluator.scala

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -302,7 +302,7 @@ trait RecursiveEvaluator
302302
case (BVLiteral(sig1, i1, s1), b2 @ BVLiteral(sig2, _, s2)) if sig1 == sig2 && s1 == s2 =>
303303
val shiftCount = b2.toBigInt.toInt
304304
val shifted = shift(i1, s1, -shiftCount)
305-
BVLiteral(sig1, if (i1(s1)) shifted ++ ((s1 - shiftCount) to s1) else shifted, s1)
305+
BVLiteral(sig1, if (i1(s1) && sig1) shifted ++ ((s1 - shiftCount) to s1) else shifted, s1)
306306
case (le,re) => throw EvalError("Unexpected operation: (" + le.asString + ") >> (" + re.asString + ")")
307307
}
308308

0 commit comments

Comments
 (0)