Commit 5ef63d19 authored by Simon Marlow's avatar Simon Marlow
Browse files

FIX #2388: check that the operand fits before using the 'test' opcode

parent 0f881aa7
......@@ -2229,7 +2229,7 @@ condIntCode cond (CmmLoad x pk) (CmmLit lit) | is32BitLit lit = do
-- anything vs zero, using a mask
-- TODO: Add some sanity checking!!!!
condIntCode cond (CmmMachOp (MO_And rep) [x,o2]) (CmmLit (CmmInt 0 pk))
| (CmmLit (CmmInt mask pk2)) <- o2
| (CmmLit lit@(CmmInt mask pk2)) <- o2, is32BitLit lit
= do
(x_reg, x_code) <- getSomeReg x
let
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment