Skip to content

Commit

Permalink
bugfix
Browse files Browse the repository at this point in the history
  • Loading branch information
lukaszcz committed Apr 10, 2024
1 parent aec5378 commit 769f03c
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions src/Juvix/Compiler/Backend/Cairo/Extra/Deserialization.hs
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ deserialize Result {..} = go [] (map (fromHexText . unpack) _resultData)
| isPrefixOf "0x" s = case readHex (drop 2 s) of
[(n, "")] -> n
_ -> error ("error parsing field element: " <> pack s)
| otherwise = error "not a hexadecimal number"
| otherwise = error ("not a hexadecimal number: " <> pack s)

go :: [Element] -> [Natural] -> [Element]
go acc = \case
Expand All @@ -32,9 +32,9 @@ deserialize Result {..} = go [] (map (fromHexText . unpack) _resultData)
where
instr =
Instruction
{ _instrOffDst = fromBiasedRepr (e .&. 0xF),
_instrOffOp0 = fromBiasedRepr (shiftR e 16 .&. 0xF),
_instrOffOp1 = fromBiasedRepr (shiftR e 32 .&. 0xF),
{ _instrOffDst = fromBiasedRepr (e .&. 0xFFFF),
_instrOffOp0 = fromBiasedRepr (shiftR e 16 .&. 0xFFFF),
_instrOffOp1 = fromBiasedRepr (shiftR e 32 .&. 0xFFFF),
_instrDstReg = goReg (testBit e 48),
_instrOp0Reg = goReg (testBit e 49),
_instrOp1Src = goOp1Src (shiftR e 50 .&. 0x7),
Expand Down

0 comments on commit 769f03c

Please sign in to comment.