Acces Violation: assert with null instance

Frits van Bommel fvbommel at REMwOVExCAPSs.nl
Fri Jan 26 10:08:20 PST 2007


Sean Kelly wrote:
> Frits van Bommel wrote:
>> Yes, an assert(o !is null) is performed. But it's performed *inside* 
>> _d_invariant, which is part of Phobos. And since Phobos is only 
>> distributed as a release build, that means the assert is off by 
>> default _even if *your* program has asserts enabled_. You need to 
>> recompile Phobos to change this behavior. This is bad.
>>
>> Perhaps that assert should just be converted to an "if (!o) 
>> _d_assert(__FILE__, __LINE__)" since _d_invariant will (presumably) 
>> only be called if the application has assertions enabled?
> 
> I think the problem is more that Phobos only ships with a release build 
> rather than that the code is broken.  What should probably be the case 
> is that DMD should link phobos.lib if -release is set and link 
> phobosd.lib otherwise.  Specifying both -debug and -release... well, I'm 
> not sure what that does so I can't say :-)

Separate libraries is also an option, of course ;).


More information about the Digitalmars-d-bugs mailing list