[Issue 285] New: Struct method null pointer assert has line number of "0"
kris
foo at bar.com
Sat Aug 12 16:13:01 PDT 2006
d-bugmail at puremagic.com wrote:
> http://d.puremagic.com/issues/show_bug.cgi?id=285
>
> Summary: Struct method null pointer assert has line number of "0"
> Product: D
> Version: 0.163
> Platform: PC
> OS/Version: Windows
> Status: NEW
> Severity: normal
> Priority: P2
> Component: DMD
> AssignedTo: bugzilla at digitalmars.com
> ReportedBy: jarrett.billingsley at gmail.com
>
>
> struct S
> {
> void fork()
> {
>
> }
> }
>
> void main()
> {
> S* s = null;
> s.fork();
> }
>
> This causes an AssertError with the correct module name, but with a line number
> of 0, which is really, really unhelpful.
>
> I didn't know DMD even inserted this null check, I think it's pretty cool :)
> Would be nice if it included the message "struct 'this' pointer is null" or
> "struct method called through null pointer" or something along those lines.
>
>
Cute and all; but I sure hope such codegen is disabled via a switch such
as -release ...
More information about the Digitalmars-d-bugs
mailing list