#3153: Panic on syntactically wrong LANGUAGE pragma
--------------------+-------------------------------------------------------
Reporter:  b_jonas  |          Owner:                
    Type:  bug      |         Status:  new           
Priority:  normal   |      Component:  Compiler      
 Version:  6.10.2   |       Severity:  minor         
Keywords:           |       Testcase:                
      Os:  Linux    |   Architecture:  x86_64 (amd64)
--------------------+-------------------------------------------------------
 I'm getting a panic from runghc.  The program I'm compiling has a syntax
 error in the LANGUAGE pragma, but I still think I should get an error
 message instead of a panic.

 I'm using ghc-6.10.2 compiled from vanilla sources (with extralibs and a
 few options in build.mk) on an amd64 debian etch linux system.

 Below you can see a transscript of the compilation including the panic
 message, and the source code.

 {{{
 [am]king ~/a/tmp$ runghc Bug
 ghc: panic! (the 'impossible' happened)
   (GHC version 6.10.2 for x86_64-unknown-linux):
         getOptions'.parseLanguage(2) went past eof token

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

 1[am]king ~/a/tmp$ cat Bug.hs
 {-# LANGUAGE - #-}
 main = return ();
 [am]king ~/a/tmp$ cat -A Bug.hs
 {-# LANGUAGE - #-}$
 main = return ();$
 [am]king ~/a/tmp$ gcc -v
 Using built-in specs.
 Target: x86_64-unknown-linux-gnu
 Configured with: ../gcc-4.3.3/configure --enable-languages=c,c++
 Thread model: posix
 gcc version 4.3.3 (GCC)
 [am]king ~/a/tmp$ runghc -v -dcore-lint Bug
 Glasgow Haskell Compiler, Version 6.10.2, for Haskell 98, stage 2 booted
 by GHC version 6.10.1
 Using package config file: /usr/local/ghc/lib/ghc-6.10.2/./package.conf
 hiding package base-3.0.3.1 to avoid conflict with later version
 base-4.1.0.0
 wired-in package ghc-prim mapped to ghc-prim-0.1.0.0
 wired-in package integer mapped to integer-0.1.0.1
 wired-in package base mapped to base-4.1.0.0
 wired-in package rts mapped to rts-1.0
 wired-in package haskell98 mapped to haskell98-1.0.1.0
 wired-in package syb mapped to syb-0.1.0.1
 wired-in package template-haskell mapped to template-haskell-2.3.0.1
 wired-in package dph-seq mapped to dph-seq-0.3
 wired-in package dph-par mapped to dph-par-0.3
 Hsc static flags: -ignore-dot-ghci -static
 Loading package ghc-prim ... linking ... done.
 Loading package integer ... linking ... done.
 Loading package base ... linking ... done.
 *** Chasing dependencies:
 Chasing modules from:
 Stable obj: []
 Stable BCO: []
 unload: retaining objs []
 unload: retaining bcos []
 Ready for upsweep []
 Upsweep completely successful.
 *** Deleting temp files:
 Deleting:
 *** Chasing dependencies:
 Chasing modules from: *Bug.hs
 ghc: panic! (the 'impossible' happened)
   (GHC version 6.10.2 for x86_64-unknown-linux):
         getOptions'.parseLanguage(2) went past eof token

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

 *** Deleting temp files:
 Deleting:
 *** Deleting temp dirs:
 Deleting:
 1[am]king ~/a/tmp$
 }}}

 (I found this bug when I tried to start a program with `{-# LANGUAGE
 -XPatternGuards #-}`.)

-- 
Ticket URL: <http://hackage.haskell.org/trac/ghc/ticket/3153>
GHC <http://www.haskell.org/ghc/>
The Glasgow Haskell Compiler
_______________________________________________
Glasgow-haskell-bugs mailing list
[email protected]
http://www.haskell.org/mailman/listinfo/glasgow-haskell-bugs

Reply via email to