[fpc-pascal] access violation?

Mattias Gaertner nc-gaertnma at netcologne.de
Fri Jul 27 19:24:39 CEST 2018


On Fri, 27 Jul 2018 11:06:11 -0600
Ryan Joseph <ryan at thealchemistguild.com> wrote:

>[...]
> I’m totally confused now. Since when was it ok to call methods on nil objects? 

You can't if you compile with -CR.
The RTL is not compiled with objectchecks, so it works there.

> According to this test not only can you call methods on nil objects but
> it calls the method statically (like a class method), i.e the test
> prints “DoThis”. How is that possible?

Self on x86_64 target is just a hidden argument.
It won't work with virtual methods.

Mattias




More information about the fpc-pascal mailing list