compiler bug concerning arrays
It seems that ghc always gives up when an array is built using listArray while the size of the given range is larger than the length of the list and the range and the list are big enough.
The following is an example; it was created under SuSE 9.3:
nestra@linux:~/kodu/mat/inf/p/d/f/fpm/materjal/Tyybid> ghci -v
___ ___ _
/ _ \ /\ /\/ __(_)
/ /_\// /_/ / / | | GHC Interactive, version 6.4.2, for Haskell 98.
/ /_\\/ __ / /___| | http://www.haskell.org/ghc/
\____/\/ /_/\____/|_| Type :? for help.
Using package config file: /usr/lib/ghc-6.4.2/package.conf
Hsc static flags: -static
*** Parser:
*** Desugar:
*** Simplify:
*** CorePrep:
*** ByteCodeGen:
Loading package base-1.0 ... linking ... done.
*** Parser:
*** Desugar:
*** Simplify:
*** CorePrep:
*** ByteCodeGen:
Prelude> :m Array
Prelude Array> listArray (0 , maxBound :: Int) (replicate (2 ^ 22) 0)
*** Parser:
*** Desugar:
*** Simplify:
*** CorePrep:
*** ByteCodeGen:
array <interactive>: internal error: evacuate: strange closure type 16540
Please report this as a compiler bug. See:
http://www.haskell.org/ghc/reportabug
In the same case, Hugs gives a message "array index out of range".
Trac metadata
Trac field | Value |
---|---|
Version | 6.4.2 |
Type | Bug |
TypeOfFailure | OtherFailure |
Priority | normal |
Resolution | Unresolved |
Component | Compiler |
Test case | |
Differential revisions | |
BlockedBy | |
Related | |
Blocking | |
CC | |
Operating system | |
Architecture |