Fixed a bug where multiple problems would be deemed safe as long as one didn't have a solution (as opposed to all not having solutions)

This commit is contained in:
Neil Brown 2008-01-16 10:52:51 +00:00
parent b5606eb7a9
commit 90fb5e2182

View File

@ -59,10 +59,10 @@ checkArrayUsage tree = (mapM_ checkPar $ listify (const True) tree) >> return tr
Left err -> dieP m $ "Could not work with array indexes for array \"" ++ arrName ++ "\": " ++ err
Right [] -> return () -- No problems to work with
Right problems ->
case mapM (\(vm,p) -> seqPair (return vm,uncurry solveProblem p)) problems of
case mapMaybe (\(vm,p) -> seqPair (return vm,uncurry solveProblem p)) problems of
-- No solutions; no worries!
Nothing -> return ()
Just ((varMapping,vm):_) -> do sol <- formatSolution varMapping (getCounterEqs vm)
[] -> return ()
((varMapping,vm):_) -> do sol <- formatSolution varMapping (getCounterEqs vm)
arrName' <- getRealName (A.Name undefined undefined arrName)
dieP m $ "Overlapping indexes of array \"" ++ arrName' ++ "\" when: " ++ sol