Skip to content

Commit

Permalink
Fix #1191
Browse files Browse the repository at this point in the history
The barrel shifter was being called with the wrong width; the
length of the sequence to be shifted was passed instead of the number
of bits in the index word.
  • Loading branch information
robdockins committed May 5, 2021
1 parent 282613d commit 0707bdc
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions src/Cryptol/Backend/WordValue.hs
Original file line number Diff line number Diff line change
Expand Up @@ -576,8 +576,9 @@ shiftWordByWord sym wop reindex x idx =
WordVal (wordAsLit sym -> Just (_,j)) ->
bitmapWordVal sym n =<< shiftOp bs0 j
_ ->
do idx_segs <- enumerateIndexSegments sym idx
bitmapWordVal sym n =<< barrelShifter sym (iteBit sym) shiftOp (Nat n) bs0 n idx_segs
do let idx_w = wordValueSize sym idx
idx_segs <- enumerateIndexSegments sym idx
bitmapWordVal sym n =<< barrelShifter sym (iteBit sym) shiftOp (Nat n) bs0 idx_w idx_segs

where
shiftOp vs shft =
Expand Down

0 comments on commit 0707bdc

Please sign in to comment.