[commit: ghc] master: Fix bug introduced in b2bd63f99d643f6b3eb30bb72bb9ae26d4183252 (38a844e)
Simon Marlow
marlowsd at gmail.com
Tue Jun 28 13:33:18 CEST 2011
Repository : ssh://darcs.haskell.org//srv/darcs/ghc
On branch : master
http://hackage.haskell.org/trac/ghc/changeset/38a844e496576e3460037d56202aaa067079133c
>---------------------------------------------------------------
commit 38a844e496576e3460037d56202aaa067079133c
Author: Simon Marlow <marlowsd at gmail.com>
Date: Tue Jun 28 11:42:17 2011 +0100
Fix bug introduced in b2bd63f99d643f6b3eb30bb72bb9ae26d4183252
HPC expects the end column of a span to be one less than the
convention used by SrcSpan, and we had lost the "-1", causing various
HPC tests to fail.
>---------------------------------------------------------------
compiler/deSugar/Coverage.lhs | 7 ++++++-
1 files changed, 6 insertions(+), 1 deletions(-)
diff --git a/compiler/deSugar/Coverage.lhs b/compiler/deSugar/Coverage.lhs
index fbe1ab9..13f1796 100644
--- a/compiler/deSugar/Coverage.lhs
+++ b/compiler/deSugar/Coverage.lhs
@@ -854,7 +854,12 @@ mkHpcPos pos@(RealSrcSpan s)
| isGoodSrcSpan' pos = toHpcPos (srcSpanStartLine s,
srcSpanStartCol s,
srcSpanEndLine s,
- srcSpanEndCol s)
+ srcSpanEndCol s - 1)
+ -- the end column of a SrcSpan is one
+ -- greater than the last column of the
+ -- span (see SrcLoc), whereas HPC
+ -- expects to the column range to be
+ -- inclusive, hence we subtract one above.
mkHpcPos _ = panic "bad source span; expected such spans to be filtered out"
hpcSrcSpan :: SrcSpan
More information about the Cvs-ghc
mailing list