[Issue 15889] New: Array bounds check should report index and length

via Digitalmars-d-bugs digitalmars-d-bugs at puremagic.com
Wed Apr 6 18:52:54 PDT 2016


https://issues.dlang.org/show_bug.cgi?id=15889

          Issue ID: 15889
           Summary: Array bounds check should report index and length
           Product: D
           Version: D2
          Hardware: All
                OS: All
            Status: NEW
          Severity: enhancement
          Priority: P1
         Component: dmd
          Assignee: nobody at puremagic.com
          Reporter: destructionator at gmail.com

When the compiler generates a RangeError, it does not tell what the index that
was out of bounds happened to be. This information is available to the compiler
and trivial to pass to the RangeError object, but it gets lost, wasting a LOT
of time. It is my #1 annoyance with D!

I tried to implement this in dmd and I got assert errors, but I imagine it
would be trivial for someone who actually knows how the e2ir.c file works - and
it would mean a lot to me.

I want it to pass the index and length of the array to the _d_arraybounds
function o druntime can add it to the error object.

--


More information about the Digitalmars-d-bugs mailing list