[Issue 11049] RangeError does not recognize file name modified by #line directive
d-bugmail at puremagic.com
d-bugmail at puremagic.com
Sun Aug 9 10:03:14 UTC 2020
https://issues.dlang.org/show_bug.cgi?id=11049
Walter Bright <bugzilla at digitalmars.com> changed:
What |Removed |Added
----------------------------------------------------------------------------
CC| |bugzilla at digitalmars.com
--- Comment #4 from Walter Bright <bugzilla at 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.
--
More information about the Digitalmars-d-bugs
mailing list