From 653e181fb831a04c2845d99f79f72454a88bb948 Mon Sep 17 00:00:00 2001 From: Michael Stahl Date: Tue, 7 Feb 2017 22:48:33 +0100 Subject: Revert "remove ugly operator* in DynamicErrorInfo" This reverts commit b5e3f8a5fa98a249ecd50021c33cf2a5c7a3b4fc. The problem is this: ==24217== Conditional jump or move depends on uninitialised value(s) ==24217== at 0x29A25FCE: SfxObjectShell::SetError(unsigned int, rtl::OUString const&) (objmisc.cxx:220) ==24217== by 0x29A35E6E: SfxObjectShell::ImportFrom(SfxMedium&, com::sun::star::uno::Reference const&) (objstor.cxx:2300) ==24217== by 0x29A3705C: SfxObjectShell::DoLoad(SfxMedium*) (objstor.cxx:765) ==24217== by 0x29A6BC48: SfxBaseModel::load(com::sun::star::uno::Sequence const&) (sfxbasemodel.cxx:1802) The commit is bogus because it introduces a DynamicErrorInfo::GetErrorCode(), which overloads ErrorInfo::GetErrorCode(), which is used at least in DynamicErrorInfo_Impl::RegisterEDcr() and used to return a constructor argument of DynamicErrorInfo but now returns pImpl->lErrId, which is what this statement is trying to initialize. Ultimately this causes my clang+ASAN build to fail because the uninitialized error code happens to be detected as a mere Warning: Test name: testMathMalformedXml::Import assertion failed - Expression: !xComponent.is() - loading succeeded: sw/qa/extras/ooxmlimport/data/math-malformed_xml.docx Change-Id: I9141144e0bc356ee54279948f2fce036d1831a86 --- basic/source/classes/sb.cxx | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'basic/source/classes/sb.cxx') diff --git a/basic/source/classes/sb.cxx b/basic/source/classes/sb.cxx index 74cec84f634c..60d71c79a445 100644 --- a/basic/source/classes/sb.cxx +++ b/basic/source/classes/sb.cxx @@ -1663,7 +1663,7 @@ bool StarBASIC::CError( SbError code, const OUString& rMsg, // Implementation of the code for the string transport to SFX-Error if( !rMsg.isEmpty() ) { - code = (SbError)(new StringErrorInfo( code, rMsg ))->GetErrorCode(); + code = (SbError)*new StringErrorInfo( code, rMsg ); } SetErrorData( code, l, c1, c2 ); GetSbData()->bCompilerError = true; @@ -1702,11 +1702,11 @@ bool StarBASIC::RTError( SbError code, const OUString& rMsg, sal_Int32 l, sal_In { OUString aTmp = "\'" + OUString::number(SbxErrObject::getUnoErrObject()->getNumber()) + "\'\n" + OUString(!GetSbData()->aErrMsg.isEmpty() ? GetSbData()->aErrMsg : rMsg); - code = (SbError)(new StringErrorInfo( code, aTmp ))->GetErrorCode(); + code = (SbError)*new StringErrorInfo( code, aTmp ); } else { - code = (SbError)(new StringErrorInfo( code, rMsg ))->GetErrorCode(); + code = (SbError)*new StringErrorInfo( code, rMsg ); } } -- cgit stro/collabora/cp-4.0 LibreOffice 核心代码仓库文档基金会
summaryrefslogtreecommitdiff
AgeCommit message (Expand)Author