[Bug 71043] Use STACK lint tool to clean code ...

bugzilla-daemon at freedesktop.org bugzilla-daemon at freedesktop.org
Thu Nov 7 01:39:58 PST 2013


https://bugs.freedesktop.org/show_bug.cgi?id=71043

--- Comment #14 from Stephan Bergmann <sbergman at redhat.com> ---
>From attachment 88771:

> bug: anti-simplify
> model: |
>   %68 = icmp eq %"class.configmgr::configuration_registry::<anonymous namespace>::RegistryKey"* %2, null, !dbg !5935
>   -->  false
> stack: 
>   - /home/vanz/git/mylibo/configmgr/source/configurationregistry.cxx:398:0
> ncore: 1
> core: 
>   - /home/vanz/git/mylibo/workdir/unxlngx6.pro/UnoApiHeadersTarget/udkapi/normal/com/sun/star/uno/XInterface.hdl:18:0
>     - null pointer dereference

For me, configmgr/source/configurationregistry.cxx:398 is

>     return new RegistryKey(*this, css::uno::makeAny(access_));

and
workdir/unxlngx6.pro/UnoApiHeadersTarget/udkapi/normal/com/sun/star/uno/XInterface.hdl:18
is

> class SAL_NO_VTABLE XInterface

Are they any different for you?

I'm not exactly sure what code this report is supposed to be about.  It might
be about the if statement in the implicit call to inline

> template< class interface_type >
> inline Reference< interface_type >::Reference( interface_type * pInterface ) SAL_THROW(())
> {
>     _pInterface = castToXInterface(pInterface);
>     if (_pInterface)
>         _pInterface->acquire();
> }

which is redundant in this particular case where pInterace is non-null "new
RegistryKey(...)" and castToXInterface is an inline function that transfers
non-null pointer to non-null pointer.  But that would mean that STACK is
unhelpfully too eager in reporting findings in inlined codes.

-- 
You are receiving this mail because:
You are on the CC list for the bug.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.freedesktop.org/archives/libreoffice/attachments/20131107/893e847e/attachment.html>


More information about the LibreOffice mailing list