Bug 4433 – object.Error: Access Violation missing file and line number

Status
RESOLVED
Resolution
FIXED
Severity
normal
Priority
P2
Component
dmd
Product
D
Version
D2
Platform
Other
OS
Windows
Creation time
2010-07-06T15:09:00Z
Last change time
2012-10-21T20:53:49Z
Keywords
diagnostic
Assigned to
nobody
Creator
Jesse.K.Phillips+D

Comments

Comment #0 by Jesse.K.Phillips+D — 2010-07-06T15:09:51Z
The error message when accessing a null reference of an object does not provide file and line number. void main() { Foo foo; foo.run(); } class Foo { void run() {} } The code above compiles and when run says: object.Error: Access Violation
Comment #1 by bearophile_hugs — 2010-07-06T17:03:49Z
Is the stack trace feature going to do this? To implement this I think the compiler has to add a pointer to the filename string and a line number to every call point to class methods, and more. So this can be done in nonrelease mode. In optimized builds this can be a drag.
Comment #2 by andrej.mitrovich — 2012-10-21T20:53:49Z
We have stack traces for this now.