[GHC] #13260: panic on unboxed string literal in pattern

#13260: panic on unboxed string literal in pattern -------------------------------------+------------------------------------- Reporter: rwbarton | Owner: Type: bug | Status: new Priority: normal | Milestone: Component: Compiler | Version: 8.1 Keywords: | Operating System: Unknown/Multiple Architecture: | Type of failure: None/Unknown Unknown/Multiple | Test Case: | Blocked By: Blocking: | Related Tickets: Differential Rev(s): | Wiki Page: -------------------------------------+------------------------------------- I don't think this program is meaningful, but it shouldn't cause a panic. {{{#!hs {-# LANGUAGE MagicHash #-} g y = case y of "a"# -> True _ -> False }}} {{{ [1 of 1] Compiling CaseOnString ( x/CaseOnString.hs, x/CaseOnString.o ) ghc: panic! (the 'impossible' happened) (GHC version 8.0.1 for x86_64-unknown-linux): litValue "a"# }}} The panic is also in at least 7.8, 7.10, and HEAD. `"a"#` has type `Addr#`, and I suppose that if we allow `case` on `Addr#` then it ought to use pointer equality. But the literal `"a"#` has no particular address, so matching against it in a `case` doesn't make sense. So I think we should just disallow unboxed string literals as patterns. -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/13260 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#13260: panic on unboxed string literal in pattern -------------------------------------+------------------------------------- Reporter: rwbarton | Owner: Type: bug | Status: new Priority: normal | Milestone: Component: Compiler | Version: 8.1 Resolution: | Keywords: newcomer Operating System: Unknown/Multiple | Architecture: | Unknown/Multiple Type of failure: None/Unknown | Test Case: Blocked By: | Blocking: Related Tickets: | Differential Rev(s): Wiki Page: | -------------------------------------+------------------------------------- Changes (by rwbarton): * keywords: => newcomer -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/13260#comment:1 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#13260: panic on unboxed string literal in pattern -------------------------------------+------------------------------------- Reporter: rwbarton | Owner: ruperthorlick Type: bug | Status: new Priority: normal | Milestone: Component: Compiler | Version: 8.1 Resolution: | Keywords: newcomer Operating System: Unknown/Multiple | Architecture: | Unknown/Multiple Type of failure: None/Unknown | Test Case: | parser/should_fail/T13260 Blocked By: | Blocking: Related Tickets: | Differential Rev(s): Phab:D3286 Wiki Page: | -------------------------------------+------------------------------------- Changes (by ruperthorlick): * owner: (none) => ruperthorlick * testcase: => parser/should_fail/T13260 * differential: => Phab:D3286 -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/13260#comment:2 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#13260: panic on unboxed string literal in pattern -------------------------------------+------------------------------------- Reporter: rwbarton | Owner: ruperthorlick Type: bug | Status: patch Priority: normal | Milestone: Component: Compiler | Version: 8.1 Resolution: | Keywords: newcomer Operating System: Unknown/Multiple | Architecture: | Unknown/Multiple Type of failure: None/Unknown | Test Case: | parser/should_fail/T13260 Blocked By: | Blocking: Related Tickets: | Differential Rev(s): Phab:D3286 Wiki Page: | -------------------------------------+------------------------------------- Changes (by ruperthorlick): * status: new => patch -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/13260#comment:3 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#13260: panic on unboxed string literal in pattern
-------------------------------------+-------------------------------------
Reporter: rwbarton | Owner: ruperthorlick
Type: bug | Status: patch
Priority: normal | Milestone:
Component: Compiler | Version: 8.1
Resolution: | Keywords: newcomer
Operating System: Unknown/Multiple | Architecture:
| Unknown/Multiple
Type of failure: None/Unknown | Test Case:
| parser/should_fail/T13260
Blocked By: | Blocking:
Related Tickets: | Differential Rev(s): Phab:D3286
Wiki Page: |
-------------------------------------+-------------------------------------
Comment (by Ben Gamari

#13260: panic on unboxed string literal in pattern -------------------------------------+------------------------------------- Reporter: rwbarton | Owner: ruperthorlick Type: bug | Status: closed Priority: normal | Milestone: 8.2.1 Component: Compiler | Version: 8.1 Resolution: fixed | Keywords: newcomer Operating System: Unknown/Multiple | Architecture: | Unknown/Multiple Type of failure: None/Unknown | Test Case: | parser/should_fail/T13260 Blocked By: | Blocking: Related Tickets: | Differential Rev(s): Phab:D3286 Wiki Page: | -------------------------------------+------------------------------------- Changes (by bgamari): * status: patch => closed * resolution: => fixed * milestone: => 8.2.1 -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/13260#comment:5 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#13260: panic on unboxed string literal in pattern -------------------------------------+------------------------------------- Reporter: rwbarton | Owner: ruperthorlick Type: bug | Status: closed Priority: normal | Milestone: 8.2.1 Component: Compiler | Version: 8.1 Resolution: fixed | Keywords: newcomer, | strings Operating System: Unknown/Multiple | Architecture: | Unknown/Multiple Type of failure: None/Unknown | Test Case: | parser/should_fail/T13260 Blocked By: | Blocking: Related Tickets: | Differential Rev(s): Phab:D3286 Wiki Page: | -------------------------------------+------------------------------------- Changes (by bgamari): * keywords: newcomer => newcomer, strings -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/13260#comment:6 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler
participants (1)
-
GHC