clash-lang / clash-compiler

Haskell to VHDL/Verilog/SystemVerilog compiler
https://clash-lang.org/
Other
1.44k stars 151 forks source link

Make `imap_go` eval rule lazy in index argument #2543

Closed christiaanb closed 1 year ago

christiaanb commented 1 year ago

Fixes #2542

The problem was that in the final recursive call, when imap_go would return Nil, the index argument was out-of-bounds. And because imap_go was strict in all arguments, imap_go would make the Nil undefined.

Subsequently applying reverse where the Nil is undefined, gives us a complete vector that is undefined, given that reverse is strict in its vector argument.

Still TODO: