Ticket #2249 (closed bug: wontfix)
Undeclared variable in cmm reports as panic
| Reported by: | millenix | Owned by: | |
|---|---|---|---|
| Priority: | low | Milestone: | 6.12.3 |
| Component: | Compiler | Version: | 6.9 |
| Keywords: | Cc: | ||
| Operating System: | Linux | Architecture: | x86_64 (amd64) |
| Type of failure: | None/Unknown | Difficulty: | Unknown |
| Test Case: | Blocked By: | ||
| Blocking: | Related Tickets: |
Description
In CMM code, if one makes an assignment to a variable that's not been declared, the compiler panics, in addition to reporting an almost sensible error message.
Here's code to make it happen:
testingbug
{
var = 1;
}
And here's the output it causes:
ghc-6.9.20080305: panic! (the 'impossible' happened) (GHC version 6.9.20080305 for x86_64-unknown-linux): CmmParse: var not a register Please report this as a GHC bug: http://www.haskell.org/ghc/reportabug
I see two problems here:
- As the output notes, the compiler should not panic just because the user fed it noticeably bad code. It should just report the underlying message, with a line/column reference to the offending code.
- The error message should quote the variable name about which it's complaining. When I initially discovered this, the variable name in question was data, and that was rather confusing.
Change History
Note: See
TracTickets for help on using
tickets.
