Thread overview
[Issue 11049] array bounds error uses module file name rather than file name modified by #line directive
[Issue 11049] RangeError does not recognize file name modified by #line directive
6 days ago
Dlang Bot
November 23, 2019
https://issues.dlang.org/show_bug.cgi?id=11049

Steven Schveighoffer <schveiguy@yahoo.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
           Keywords|pull                        |
                 CC|                            |schveiguy@yahoo.com

--- Comment #2 from Steven Schveighoffer <schveiguy@yahoo.com> ---
Just ran into this today. Removing the pull description because even though the PR was pulled, this is not fixed, not sure what happened.

--
November 23, 2019
https://issues.dlang.org/show_bug.cgi?id=11049

--- Comment #3 from Steven Schveighoffer <schveiguy@yahoo.com> ---
I'll note this is important to fix, as vibe.d is a showcase project of D, and diet templates use #line to help diagnose issues with diet templates.

--
August 09
https://issues.dlang.org/show_bug.cgi?id=11049

Walter Bright <bugzilla@digitalmars.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |bugzilla@digitalmars.com

--- Comment #4 from Walter Bright <bugzilla@digitalmars.com> ---
This is apparently caused by the code in e2ir.d:

elem *buildArrayBoundsError(IRState *irs, const ref Loc loc)
{
    if (irs.params.checkAction == CHECKACTION.C)
    {
        return callCAssert(irs, loc, null, null, "array overflow");
    }
    if (irs.params.checkAction == CHECKACTION.halt)
    {
        return genHalt(loc);
    }
    auto eassert = el_var(getRtlsym(RTLSYM_DARRAYP));
    auto efile = toEfilenamePtr(cast(Module)irs.blx._module); ***
    auto eline = el_long(TYint, loc.linnum);
    return el_bin(OPcall, TYvoid, eassert, el_param(eline, efile));
}

Note that it gets the filename from _module rather than loc. I believe it is this way to stop the redundant generation of filename strings into the object file. The previous function filelineFunction() gets it fro the loc.

--
August 09
https://issues.dlang.org/show_bug.cgi?id=11049

Walter Bright <bugzilla@digitalmars.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
            Summary|RangeError does not         |array bounds error uses
                   |recognize file name         |module file name rather
                   |modified by #line directive |than file name modified by
                   |                            |#line directive

--
August 29
https://issues.dlang.org/show_bug.cgi?id=11049

Walter Bright <bugzilla@digitalmars.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
           Keywords|                            |backend

--
6 days ago
https://issues.dlang.org/show_bug.cgi?id=11049

Dlang Bot <dlang-bot@dlang.rocks> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
           Keywords|                            |pull

--- Comment #5 from Dlang Bot <dlang-bot@dlang.rocks> ---
@WalterBright created dlang/dmd pull request #11741 "fix Issue 11049 - array bounds error uses module file name rather tha…" fixing this issue:

- fix Issue 11049 - array bounds error uses module file name rather than file name modified by #line directive

https://github.com/dlang/dmd/pull/11741

--