sc/source/core/data/queryiter.cxx | 3 +++ sc/source/core/tool/rangecache.cxx | 1 + 2 files changed, 4 insertions(+)
New commits: commit 11a626139a4a44422bb9eebe1cc7ef6f36b75276 Author: Luboš Luňák <l.lu...@collabora.com> AuthorDate: Wed May 18 11:08:30 2022 +0200 Commit: Luboš Luňák <l.lu...@collabora.com> CommitDate: Wed May 18 15:17:29 2022 +0200 silence coverity warnings Those fields are meant to be uninitialized by the ctor. And if they get used by mistake, I'd prefer to hear that from e.g. Valgrind rather than cover it up with some dummy default value. Change-Id: Ide57f84e9dc0fcc8c7395af99e216c7626d50913 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/134512 Tested-by: Jenkins Reviewed-by: Luboš Luňák <l.lu...@collabora.com> diff --git a/sc/source/core/data/queryiter.cxx b/sc/source/core/data/queryiter.cxx index aeb310c706b5..f1f41857fc4c 100644 --- a/sc/source/core/data/queryiter.cxx +++ b/sc/source/core/data/queryiter.cxx @@ -856,6 +856,7 @@ ScQueryCellIteratorAccessSpecific< ScQueryCellIteratorAccess::Direct > , rDoc( rDocument ) , mrContext( rContext ) { + // coverity[uninit_member] - this just contains data, subclass will initialize some of it } void ScQueryCellIteratorAccessSpecific< ScQueryCellIteratorAccess::Direct >::InitPos() @@ -1067,6 +1068,7 @@ ScQueryCellIteratorAccessSpecific< ScQueryCellIteratorAccess::SortedCache > , rDoc( rDocument ) , mrContext( rContext ) { + // coverity[uninit_member] - this just contains data, subclass will initialize some of it } void ScQueryCellIteratorAccessSpecific< ScQueryCellIteratorAccess::SortedCache >::SetSortedRangeCache( @@ -1174,6 +1176,7 @@ public: { if(mSortedRows.empty()) return; + // coverity[uninit_member] - these are initialized only if valid mLowIndex = 0; mHighIndex = mSortedRows.size() - 1; mValid = true; diff --git a/sc/source/core/tool/rangecache.cxx b/sc/source/core/tool/rangecache.cxx index f188342871c3..434ba2e6de1b 100644 --- a/sc/source/core/tool/rangecache.cxx +++ b/sc/source/core/tool/rangecache.cxx @@ -109,6 +109,7 @@ ScSortedRangeCache::ScSortedRangeCache(ScDocument* pDoc, const ScRange& rRange, std::vector<RowData> rowData; // Try to reuse as much ScQueryEvaluator code as possible, this should // basically do the same comparisons. + assert(pDoc->FetchTable(nTab) != nullptr); ScQueryEvaluator evaluator(*pDoc, *pDoc->FetchTable(nTab), param, context); for (SCROW nRow = startRow; nRow <= endRow; ++nRow) {