Q_ASSERT usage
David Nolden
zwabel at googlemail.com
Wed Dec 17 12:16:00 UTC 2008
Am Mittwoch, 17. Dezember 2008 06:34:35 schrieb Nick Shaforostoff:
> in kdevplatform/language/duchain/declaration.cpp i found this code:
>
> // If the parent-context already has dynamic data, like for example
> any temporary context,
> // always delete the declaration, to not create crashes within more
> complex code like C++ template stuff.
> if (context() && !d_func()->m_anonymousInContext) {
> if(!topContext->deleting() || !topContext->isOnDisk() ||
> context()->d_func()->isDynamic())
> Q_ASSERT(context()->m_dynamicData->removeDeclaration(this));
> }
>
> when compiled in release mode, this is equivalent of
>
> if (context() && !d_func()->m_anonymousInContext) {
> if(!topContext->deleting() || !topContext->isOnDisk() ||
> context()->d_func()->isDynamic())
> ;
> }
>
> is this intended behaviour?
No it is definitely not! It may be possible that there's a few more places in
kdevplatform/kdevelop where this problem appears. Thanks for spotting this.
Greetings, David
More information about the KDevelop-devel
mailing list