D-Programming-Language/dmd — pull request #4064 by nemanja-boric-sociomantic (2014-10-13 10:05:19+00:00)
Title: Fix `toEmodulename` in 64bit version

`toEmodulename` didn't work with the 64bit build of dmd because of the fixed offset that's doubled in the 64 bit build. This caused very nasty (and very hard to isolate and reduce) bug when assertion or exception message only shows line number if there's a module constructor or destructor in any module imported in the project:

```D
void main()
{
int a[];
a[5] = 5;
}
```

outputs:

terminated after throwing an uncaught instance of 'tango.core.Exception.ArrayBoundsException' at test.d:4
toString(): Array index out of bounds

but:

```D
static this() {}
void main()
{
int a[];
a[5] = 5;
}
```

outputs:

terminated after throwing an uncaught instance of 'tango.core.Exception.ArrayBoundsException'
toString(): Array index out of bounds

32bit build of dmd works fine. The PR was tested against both 64bit and 32bit builds.