[Libreoffice-commits] core.git: sw/source

Stephan Bergmann (via logerrit) logerrit at kemper.freedesktop.org
Sat Aug 8 21:59:15 UTC 2020


 sw/source/core/tox/txmsrt.cxx |   12 +++++-------
 1 file changed, 5 insertions(+), 7 deletions(-)

New commits:
commit 11a54f7358488b24de87cc37cdcb387965c6d2a4
Author:     Stephan Bergmann <sbergman at redhat.com>
AuthorDate: Sat Aug 8 22:54:09 2020 +0200
Commit:     Stephan Bergmann <sbergman at redhat.com>
CommitDate: Sat Aug 8 23:58:33 2020 +0200

    Remove unnecessary, wrong downcast
    
    ...during UITest_writer_tests4:
    
    > /sw/source/core/tox/txmsrt.cxx:310:30: runtime error: downcast of address 0x60f00032cd40 which does not point to an object of type 'const SwTOXIndex'
    > 0x60f00032cd40: note: object is of type 'SwTOXCustom'
    >  47 07 80 4f  90 c1 34 d7 39 2b 00 00  00 00 00 00 00 00 00 00  00 00 00 00 00 00 00 00  01 00 00 00
    >               ^~~~~~~~~~~~~~~~~~~~~~~
    >               vptr for 'SwTOXCustom'
    >     #0 0x2b39cf605eb9 in SwTOXIndex::sort_lt(SwTOXSortTabBase const&) /sw/source/core/tox/txmsrt.cxx:310:30
    >     #1 0x2b39cc9223b7 in SwTOXBaseSection::InsertSorted(std::unique_ptr<SwTOXSortTabBase, std::default_delete<SwTOXSortTabBase> >) /sw/source/core/doc/doctxm.cxx:1946:19
    >     #2 0x2b39cc90c5a7 in SwTOXBaseSection::UpdateMarks(SwTOXInternational const&, SwTextNode const*, SwRootFrame const*) /sw/source/core/doc/doctxm.cxx:1219:13
    >     #3 0x2b39cc8f6ab1 in SwTOXBaseSection::Update(SfxItemSet const*, SwRootFrame const*, bool) /sw/source/core/doc/doctxm.cxx:872:9
    >     #4 0x2b39d02a07b0 in SwXDocumentIndex::refresh() /sw/source/core/unocore/unoidx.cxx:1261:19
    >     #5 0x2b39d028bcd3 in SwXDocumentIndex::update() /sw/source/core/unocore/unoidx.cxx:517:12
    >     #6 0x2b3e6a642d3b in SwMultiTOXTabDialog::CreateOrUpdateExample(TOXTypes, unsigned short, unsigned short) /sw/source/ui/index/cntex.cxx:383:67
    >     #7 0x2b3e6a637d45 in SwMultiTOXTabDialog::CreateExample_Hdl(SwOneExampleFrame&) /sw/source/ui/index/cntex.cxx:117:9
    >     #8 0x2b3e6a63602a in SwMultiTOXTabDialog::LinkStubCreateExample_Hdl(void*, SwOneExampleFrame&) /sw/source/ui/index/cntex.cxx:85:1
    >     #9 0x2b39d33ffc99 in Link<SwOneExampleFrame&, void>::Call(SwOneExampleFrame&) const /include/tools/link.hxx:111:45
    >     #10 0x2b39d33fa895 in SwOneExampleFrame::TimeoutHdl(Timer*) /sw/source/uibase/utlui/unotools.cxx:403:28
    >     #11 0x2b39d33e7d3a in SwOneExampleFrame::LinkStubTimeoutHdl(void*, Timer*) /sw/source/uibase/utlui/unotools.cxx:210:1
    >     #12 0x2b396b968321 in Link<Timer*, void>::Call(Timer*) const /include/tools/link.hxx:111:45
    >     #13 0x2b396b9678b8 in Timer::Invoke() /vcl/source/app/timer.cxx:75:21
    >     #14 0x2b396b7ad806 in Scheduler::ProcessTaskScheduling() /vcl/source/app/scheduler.cxx:484:20
    >     #15 0x2b396b7a7680 in Scheduler::CallbackTaskScheduling() /vcl/source/app/scheduler.cxx:287:5
    >     #16 0x2b396c3fb790 in SalTimer::CallCallback() /vcl/inc/saltimer.hxx:54:13
    >     #17 0x2b396c3eeefc in SvpSalInstance::CheckTimeout(bool) /vcl/headless/svpinst.cxx:209:53
    >     #18 0x2b396c3f5665 in SvpSalInstance::DoYield(bool, bool) /vcl/headless/svpinst.cxx:444:21
    >     #19 0x2b396b8a6af9 in ImplYield(bool, bool) /vcl/source/app/svapp.cxx:455:48
    >     #20 0x2b396b8a5cb7 in Application::Yield() /vcl/source/app/svapp.cxx:519:5
    >     #21 0x2b396b8a58f9 in Application::Execute() /vcl/source/app/svapp.cxx:434:9
    >     #22 0x2b39302e879c in desktop::Desktop::Main() /desktop/source/app/app.cxx:1600:17
    >     #23 0x2b396b94ff29 in ImplSVMain() /vcl/source/app/svmain.cxx:201:35
    >     #24 0x2b396b959e00 in SVMain() /vcl/source/app/svmain.cxx:233:12
    >     #25 0x2b39304ca014 in soffice_main /desktop/source/app/sofficemain.cxx:98:12
    >     #26 0x4efc6c in sal_main /desktop/source/app/main.c:48:15
    >     #27 0x4efc46 in main /desktop/source/app/main.c:47:1
    >     #28 0x2b393208f504 in __libc_start_main (/lib64/libc.so.6+0x22504)
    >     #29 0x41b5c1 in _start (/instdir/program/soffice.bin+0x41b5c1)
    
    (<https://ci.libreoffice.org//job/lo_ubsan/1721/>)
    
    Change-Id: I02fcbd23d13843563042aca7b1e9fed73823ecb8
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/100394
    Tested-by: Jenkins
    Reviewed-by: Stephan Bergmann <sbergman at redhat.com>

diff --git a/sw/source/core/tox/txmsrt.cxx b/sw/source/core/tox/txmsrt.cxx
index 2ed59c86dcc8..a0a14f307035 100644
--- a/sw/source/core/tox/txmsrt.cxx
+++ b/sw/source/core/tox/txmsrt.cxx
@@ -307,23 +307,21 @@ bool SwTOXIndex::equivalent(const SwTOXSortTabBase& rCmpBase)
 
 bool SwTOXIndex::sort_lt(const SwTOXSortTabBase& rCmpBase)
 {
-    const SwTOXIndex& rCmp = static_cast<const SwTOXIndex&>(rCmpBase);
-
     OSL_ENSURE(pTextMark, "pTextMark == 0, No keyword");
 
     const TextAndReading aMyTaR(GetText());
-    const TextAndReading aOtherTaR(rCmp.GetText());
+    const TextAndReading aOtherTaR(rCmpBase.GetText());
 
-    bool bRet = GetLevel() == rCmp.GetLevel() &&
+    bool bRet = GetLevel() == rCmpBase.GetLevel() &&
                 pTOXIntl->IsLess( aMyTaR, GetLocale(),
-                                  aOtherTaR, rCmp.GetLocale() );
+                                  aOtherTaR, rCmpBase.GetLocale() );
 
     // If we don't summarize we need to evaluate the Pos
     if( !bRet && !(GetOptions() & SwTOIOptions::SameEntry) )
     {
         bRet = pTOXIntl->IsEqual( aMyTaR, GetLocale(),
-                                  aOtherTaR, rCmp.GetLocale() ) &&
-               nPos < rCmp.nPos;
+                                  aOtherTaR, rCmpBase.GetLocale() ) &&
+               nPos < rCmpBase.nPos;
     }
 
     return bRet;


More information about the Libreoffice-commits mailing list