The compiler doesn't currently check that the width of an indexed part select is non-zero. If code contains this erroneous case, the compiler can crash (with an assertion failure). This patch causes the compiler to output a suitable error message and recover. It also fixes a potential crash if an illegal expresson is encountered.
This patch can be applied to both devel and v0.9.
I'm also attaching a patch which stops the compiler generating duplicate error messages for this condition. This second patch is for devel only.
Also attached is a regression test for the test suite. This test should produce a compile error.
Patch to fix bug (devel and v0.9)
Patch to fix error reporting (devel only)
Regression test for test suite
Applied to git master.
Applied to git v0_9-branch.