From 83638dce4e20097b9b7073534e488a92dce6e88f Mon Sep 17 00:00:00 2001 From: M Farkas-Dyck Date: Thu, 29 Sep 2022 01:03:13 -0800 Subject: Scrub various partiality involving lists (again). Lets us avoid some use of `head` and `tail`, and some panics. --- compiler/GHC/CmmToAsm/X86/CodeGen.hs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'compiler/GHC/CmmToAsm/X86/CodeGen.hs') diff --git a/compiler/GHC/CmmToAsm/X86/CodeGen.hs b/compiler/GHC/CmmToAsm/X86/CodeGen.hs index 9861177c3a..fd85ae6154 100644 --- a/compiler/GHC/CmmToAsm/X86/CodeGen.hs +++ b/compiler/GHC/CmmToAsm/X86/CodeGen.hs @@ -3353,9 +3353,9 @@ invertCondBranches (Just cfg) keep bs = invert bs where invert :: [NatBasicBlock Instr] -> [NatBasicBlock Instr] - invert ((BasicBlock lbl1 ins@(_:_:_xs)):b2@(BasicBlock lbl2 _):bs) + invert (BasicBlock lbl1 ins:b2@(BasicBlock lbl2 _):bs) | --pprTrace "Block" (ppr lbl1) True, - (jmp1,jmp2) <- last2 ins + Just (jmp1,jmp2) <- last2 ins , JXX cond1 target1 <- jmp1 , target1 == lbl2 --, pprTrace "CutChance" (ppr b1) True -- cgit v1.2.1