Skip to content

Commit 2cb409a

Browse files
committed
BitvectorFormulaManager: fix ROL/ROR for cases, where rotation is done by bitsize^2-1.
The bug should when using small bitsize (=2) and rotate by 1.
1 parent 937dbb9 commit 2cb409a

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/org/sosy_lab/java_smt/basicimpl/AbstractBitvectorFormulaManager.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -340,7 +340,7 @@ public BitvectorFormula rotateLeft(BitvectorFormula pNumber, BitvectorFormula pT
340340
protected TFormulaInfo rotateLeft(TFormulaInfo pNumber, TFormulaInfo pToRotate) {
341341
int length = getLength(wrap(pNumber));
342342
final TFormulaInfo lengthAsBv = makeBitvectorImpl(length, length);
343-
final TFormulaInfo toRotateInRange = smodulo(pToRotate, lengthAsBv);
343+
final TFormulaInfo toRotateInRange = remainder(pToRotate, lengthAsBv, false);
344344
return or(
345345
shiftLeft(pNumber, toRotateInRange),
346346
shiftRight(pNumber, subtract(lengthAsBv, toRotateInRange), false));
@@ -373,7 +373,7 @@ public BitvectorFormula rotateRight(BitvectorFormula pNumber, BitvectorFormula p
373373
protected TFormulaInfo rotateRight(TFormulaInfo pNumber, TFormulaInfo pToRotate) {
374374
int length = getLength(wrap(pNumber));
375375
final TFormulaInfo lengthAsBv = makeBitvectorImpl(length, length);
376-
final TFormulaInfo toRotateInRange = smodulo(pToRotate, lengthAsBv);
376+
final TFormulaInfo toRotateInRange = remainder(pToRotate, lengthAsBv, false);
377377
return or(
378378
shiftRight(pNumber, toRotateInRange, false),
379379
shiftLeft(pNumber, subtract(lengthAsBv, toRotateInRange)));

0 commit comments

Comments
 (0)