Skip to content

Commit

Permalink
Make shiftDef sensitive to FlagDisablePact47
Browse files Browse the repository at this point in the history
  • Loading branch information
jwiegley committed Apr 27, 2023
1 parent 5004220 commit a29f859
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions src/Pact/Native/Ops.hs
Original file line number Diff line number Diff line change
Expand Up @@ -570,8 +570,10 @@ shiftDef = defRNative "shift" go
)
where
go i [TLiteral (LInteger x) xi,TLiteral (LInteger y) yi]
| y > 0 = do
z <- powImpl i [TLiteral (LInteger 2) yi, TLiteral (LInteger y) yi]
mulImpl i [TLiteral (LInteger x) xi, z]
| y > 0 = isExecutionFlagSet FlagDisablePact47 >>= \case
True -> return $ toTerm $ shift x (fromIntegral y)
False -> do
z <- powImpl i [TLiteral (LInteger 2) yi, TLiteral (LInteger y) yi]
mulImpl i [TLiteral (LInteger x) xi, z]
| otherwise = return $ toTerm $ shift x (fromIntegral y)
go i as = argsError i as

0 comments on commit a29f859

Please sign in to comment.