New Defects reported by Coverity Scan for LibreOffice

Stephan Bergmann sbergman at redhat.com
Tue Apr 7 01:54:50 PDT 2015


On 04/04/2015 07:18 PM, scan-admin at coverity.com wrote:
> ** CID 1292911:    (PASS_BY_VALUE)
> /usr/include/c++/4.9.2/functional: 2419 in std::function<SvxLRSpaceItem ()>::function<SwTableProperties_Impl::ApplyTblAttr(const SwTable &, SwDoc &)::[lambda() (instance 4)], void>(T1)()
> /usr/include/c++/4.9.2/functional: 2419 in std::function<SvxULSpaceItem ()>::function<SwTableProperties_Impl::ApplyTblAttr(const SwTable &, SwDoc &)::[lambda() (instance 5)], void>(T1)()
> /usr/include/c++/4.9.2/functional: 2419 in std::function<SvxFmtBreakItem ()>::function<SwTableProperties_Impl::ApplyTblAttr(const SwTable &, SwDoc &)::[lambda() (instance 2)], void>(T1)()
> /usr/include/c++/4.9.2/functional: 2419 in std::function<SvxBrushItem ()>::function<SwTableProperties_Impl::ApplyTblAttr(const SwTable &, SwDoc &)::[lambda() (instance 1)], void>(T1)()
> /usr/include/c++/4.9.2/functional: 2419 in std::function<SvxFmtKeepItem ()>::function<SwTableProperties_Impl::ApplyTblAttr(const SwTable &, SwDoc &)::[lambda() (instance 3)], void>(T1)()
>
>
> ________________________________________________________________________________________________________
> *** CID 1292911:    (PASS_BY_VALUE)
> /usr/include/c++/4.9.2/functional: 2419 in std::function<SvxLRSpaceItem ()>::function<SwTableProperties_Impl::ApplyTblAttr(const SwTable &, SwDoc &)::[lambda() (instance 4)], void>(T1)()
> 2413     	}
> 2414         }
> 2415
> 2416       template<typename _Res, typename... _ArgTypes>
> 2417         template<typename _Functor, typename>
> 2418           function<_Res(_ArgTypes...)>::
>>>>      CID 1292911:    (PASS_BY_VALUE)
>>>>      Passing parameter __f of type "SwTableProperties_Impl::ApplyTblAttr(SwTable const &, SwDoc &)::[lambda() (instance 4)]" (size 168 bytes) by value.
> 2419           function(_Functor __f)
> 2420           : _Function_base()
> 2421           {
> 2422     	typedef _Function_handler<_Signature_type, _Functor> _My_handler;
> 2423
> 2424     	if (_My_handler::_M_not_empty_function(__f))

This is kind of a gotcha.  Note how entities of reference-to-object type 
are captured by copy.  Fixed with 
<http://cgit.freedesktop.org/libreoffice/core/commit/?id=82b71d4764c12eb173f6d98b94d6bbbc5d296d7e> 
"Coverity#1292911: Capture by reference."



More information about the LibreOffice mailing list