diff options
Diffstat (limited to 'compiler/GHC/Cmm/Lint.hs')
-rw-r--r-- | compiler/GHC/Cmm/Lint.hs | 7 |
1 files changed, 3 insertions, 4 deletions
diff --git a/compiler/GHC/Cmm/Lint.hs b/compiler/GHC/Cmm/Lint.hs index 2fd19ec507..7225a64141 100644 --- a/compiler/GHC/Cmm/Lint.hs +++ b/compiler/GHC/Cmm/Lint.hs @@ -187,10 +187,9 @@ lintCmmLast labels node = case node of platform <- getPlatform mapM_ checkTarget $ switchTargetsToList ids erep <- lintCmmExpr e - if (erep `cmmEqType_ignoring_ptrhood` bWord platform) - then return () - else cmmLintErr (text "switch scrutinee is not a word: " <> - pdoc platform e <> text " :: " <> ppr erep) + unless (isWordAny erep) $ + cmmLintErr (text "switch scrutinee is not a word (of any size): " <> + pdoc platform e <> text " :: " <> ppr erep) CmmCall { cml_target = target, cml_cont = cont } -> do _ <- lintCmmExpr target |