dotgnu-general
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [DotGNU]Bug - null objects and stack traces.


From: Rhys Weatherley
Subject: Re: [DotGNU]Bug - null objects and stack traces.
Date: Mon, 07 Oct 2002 07:35:58 +1000

Gopal V wrote:

> "call" instruction does not throw a NullReferenceException , but
> "callvirt" does ... But "why ?" is not something I can answer.

"call" doesn't look at the "this" value on the stack, so it
never knows if it is null or not.

"callvirt" must look at the "this" value on the stack, to fetch
the pointer to the vtable from the object.  In the process,
it must check for the null pointer.

See "pnet/engine/cvm_call.c" under COP_CALL and COP_CALL_VIRTUAL
for the gory details.

Cheers,

Rhys.


reply via email to

[Prev in Thread] Current Thread [Next in Thread]