Bug 18130 – ICE on zero-length `out` array parameter

Status
RESOLVED
Resolution
FIXED
Severity
critical
Priority
P1
Component
dmd
Product
D
Version
D2
Platform
All
OS
All
Creation time
2017-12-27T13:45:50Z
Last change time
2018-04-05T07:37:09Z
Keywords
industry, pull
Assigned to
No Owner
Creator
johanengelen

Comments

Comment #0 by johanengelen — 2017-12-27T13:45:50Z
Testcase code: ``` void foo(out byte[0] v) { } ``` Testcase cmdline: `dmd -c dsymbolsem_assert.d` This asserts in dsymbolsem.d: https://github.com/dlang/dmd/blob/67ccf216a20e5b45b0fd4136a750b07ded4c8461/src/dmd/dsymbolsem.d#L1427 If anything, this needs better diagnostics (easy to implement a printout of the function and param for which the error happens).
Comment #1 by greensunny12 — 2018-04-04T06:23:27Z
All ICEs are critical! A simple PR that triggers an error instead of the ICE: https://github.com/dlang/dmd/pull/8127
Comment #2 by github-bugzilla — 2018-04-05T07:37:08Z
Commits pushed to master at https://github.com/dlang/dmd https://github.com/dlang/dmd/commit/5abef224cbd6c580239e2cf401bb74044bb4bb3e Fix Issue 18130 - ICE on zero-length `out` array parameter https://github.com/dlang/dmd/commit/6957a6a622d05cd0251428b2d948b219db2d8665 Merge pull request #8127 from wilzbach/fix-18130 Fix Issue 18130 - ICE on zero-length `out` array parameter merged-on-behalf-of: Jacob Carlborg <[email protected]>