projects
/
ghc-hetmet.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
ea16a2e
)
check that the argument to CmmCondBranch is really a conditional
author
Simon Marlow
<simonmar@microsoft.com>
Tue, 20 Jun 2006 14:12:04 +0000
(14:12 +0000)
committer
Simon Marlow
<simonmar@microsoft.com>
Tue, 20 Jun 2006 14:12:04 +0000
(14:12 +0000)
compiler/cmm/CmmLint.hs
patch
|
blob
|
history
diff --git
a/compiler/cmm/CmmLint.hs
b/compiler/cmm/CmmLint.hs
index
fbfb14c
..
83444e5
100644
(file)
--- a/
compiler/cmm/CmmLint.hs
+++ b/
compiler/cmm/CmmLint.hs
@@
-118,11
+118,15
@@
lintCmmStmt (CmmStore l r) = do
lintCmmExpr r
return ()
lintCmmStmt (CmmCall _target _res args _vols) = mapM_ (lintCmmExpr.fst) args
lintCmmExpr r
return ()
lintCmmStmt (CmmCall _target _res args _vols) = mapM_ (lintCmmExpr.fst) args
-lintCmmStmt (CmmCondBranch e _id) = lintCmmExpr e >> return ()
+lintCmmStmt (CmmCondBranch e _id) = lintCmmExpr e >> checkCond e >> return ()
lintCmmStmt (CmmSwitch e _branches) = lintCmmExpr e >> return ()
lintCmmStmt (CmmJump e _args) = lintCmmExpr e >> return ()
lintCmmStmt _other = return ()
lintCmmStmt (CmmSwitch e _branches) = lintCmmExpr e >> return ()
lintCmmStmt (CmmJump e _args) = lintCmmExpr e >> return ()
lintCmmStmt _other = return ()
+checkCond (CmmMachOp mop _) | isComparisonMachOp mop = return ()
+checkCond expr = cmmLintErr (hang (text "expression is not a conditional:") 2
+ (ppr expr))
+
-- -----------------------------------------------------------------------------
-- CmmLint monad
-- -----------------------------------------------------------------------------
-- CmmLint monad