summaryrefslogtreecommitdiff
path: root/compiler/deSugar
diff options
context:
space:
mode:
authorSimon Marlow <marlowsd@gmail.com>2011-06-28 11:42:17 +0100
committerSimon Marlow <marlowsd@gmail.com>2011-06-28 11:42:56 +0100
commit38a844e496576e3460037d56202aaa067079133c (patch)
tree5b858070b127ad00b16806955deecc6b6bd7222a /compiler/deSugar
parentac0800b6bfdb7b1f3895fe33981e0bc853b0d409 (diff)
downloadhaskell-38a844e496576e3460037d56202aaa067079133c.tar.gz
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.
Diffstat (limited to 'compiler/deSugar')
-rw-r--r--compiler/deSugar/Coverage.lhs7
1 files changed, 6 insertions, 1 deletions
diff --git a/compiler/deSugar/Coverage.lhs b/compiler/deSugar/Coverage.lhs
index fbe1ab9a45..13f179644a 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