Ticket #5181 (closed bug: fixed)

Opened 2 years ago

Last modified 2 years ago

HEAD panics on mc17

Reported by: daniel.is.fischer Owned by:
Priority: normal Milestone:
Component: Compiler Version: 7.1
Keywords: Cc:
Operating System: Unknown/Multiple Architecture: Unknown/Multiple
Type of failure: None/Unknown Difficulty:
Test Case: Blocked By:
Blocking: Related Tickets:

Description

Unexpected failure for mc17 (all ways):

ghc-stage2: panic! (the 'impossible' happened)
  (GHC version 7.1.20110509 for i386-unknown-linux):
	tcSyntaxOp "noSyntaxExpr"

Please report this as a GHC bug:  http://www.haskell.org/ghc/reportabug


*** unexpected failure for mc17(normal)

Change History

Changed 2 years ago by simonpj

  • status changed from new to closed
  • resolution set to fixed

Fixed by

commit 6a1aab7737016aa714b2ffec2b5657a18fac0e42
Author: Simon Peyton Jones <simonpj@microsoft.com>
Date:   Mon May 9 16:45:12 2011 +0100

    Fix renaming of guards
    
    This was making mc17 fail.

>---------------------------------------------------------------

 compiler/hsSyn/HsExpr.lhs  |   10 ++++++----
 compiler/rename/RnExpr.lhs |    2 ++
 2 files changed, 8 insertions(+), 4 deletions(-)

diff --git a/compiler/hsSyn/HsExpr.lhs b/compiler/hsSyn/HsExpr.lhs index 9c88783..dd33cae 100644
--- a/compiler/hsSyn/HsExpr.lhs
+++ b/compiler/hsSyn/HsExpr.lhs
@@ -1274,10 +1274,12 @@ data HsStmtContext id  \begin{code}  isListCompExpr :: HsStmtContext id -> Bool
 -- Uses syntax [ e | quals ]
-isListCompExpr ListComp  = True
-isListCompExpr PArrComp  = True
-isListCompExpr MonadComp = True
-isListCompExpr _         = False
+isListCompExpr ListComp  	 = True
+isListCompExpr PArrComp  	 = True
+isListCompExpr MonadComp 	 = True  
+isListCompExpr (ParStmtCtxt c)   = isListCompExpr c
+isListCompExpr (TransStmtCtxt c) = isListCompExpr c
+isListCompExpr _                 = False
 
 isMonadCompExpr :: HsStmtContext id -> Bool
 isMonadCompExpr MonadComp            = True
diff --git a/compiler/rename/RnExpr.lhs b/compiler/rename/RnExpr.lhs index 46eef67..88e0462 100644
--- a/compiler/rename/RnExpr.lhs
+++ b/compiler/rename/RnExpr.lhs
@@ -694,6 +694,8 @@ rnStmt ctxt (L loc (ExprStmt expr _ _ _)) thing_inside
                               then lookupStmtName ctxt guardMName
 			      else return (noSyntaxExpr, emptyFVs)
 			      -- Only list/parr/monad comprehensions use 'guard'
+			      -- Also for sub-stmts of same eg [ e | x<-xs, gd | blah ]
+			      -- Here "gd" is a guard
 	; (thing, fvs3)    <- thing_inside []
 	; return (([L loc (ExprStmt expr' then_op guard_op placeHolderType)], thing),
 		  fv_expr `plusFV` fvs1 `plusFV` fvs2 `plusFV` fvs3) }
Note: See TracTickets for help on using tickets.