diff options
author | Michael Stahl <mstahl@redhat.com> | 2017-02-07 22:48:33 +0100 |
---|---|---|
committer | Michael Stahl <mstahl@redhat.com> | 2017-02-07 23:02:57 +0100 |
commit | 653e181fb831a04c2845d99f79f72454a88bb948 (patch) | |
tree | 3ec424e8c21f15573226f7f40eb9bd7e97f49107 /basic/source/basmgr | |
parent | 32cae6a2eaa41568888df9c8fc5605debd8d704a (diff) |
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<com::sun::star::text::XTextRange> const&) (objstor.cxx:2300)
==24217== by 0x29A3705C: SfxObjectShell::DoLoad(SfxMedium*) (objstor.cxx:765)
==24217== by 0x29A6BC48:
SfxBaseModel::load(com::sun::star::uno::Sequence<com::sun::star::beans::PropertyValue> 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
Diffstat (limited to 'basic/source/basmgr')
-rw-r--r-- | basic/source/basmgr/basmgr.cxx | 20 |
1 files changed, 10 insertions, 10 deletions
diff --git a/basic/source/basmgr/basmgr.cxx b/basic/source/basmgr/basmgr.cxx index 286a9c4f5d25..9b0c92a850fc 100644 --- a/basic/source/basmgr/basmgr.cxx +++ b/basic/source/basmgr/basmgr.cxx @@ -634,10 +634,10 @@ BasicManager::BasicManager( StarBASIC* pSLib, OUString* pLibPath, bool bDocMgr ) void BasicManager::ImpMgrNotLoaded( const OUString& rStorageName ) { - // pErrInf is only destroyed if the error is processed by an + // pErrInf is only destroyed if the error os processed by an // ErrorHandler StringErrorInfo* pErrInf = new StringErrorInfo( ERRCODE_BASMGR_MGROPEN, rStorageName, ERRCODE_BUTTON_OK ); - aErrors.push_back(BasicError(pErrInf->GetErrorCode(), BasicErrorReason::OPENMGRSTREAM)); + aErrors.push_back(BasicError(*pErrInf, BasicErrorReason::OPENMGRSTREAM)); // Create a stdlib otherwise we crash! BasicLibInfo* pStdLibInfo = CreateLibInfo(); @@ -777,7 +777,7 @@ void BasicManager::LoadOldBasicManager( SotStorage& rStorage ) if (!ImplLoadBasic( *xManagerStream, mpImpl->aLibs.front()->GetLibRef() )) { StringErrorInfo* pErrInf = new StringErrorInfo( ERRCODE_BASMGR_MGROPEN, aStorName, ERRCODE_BUTTON_OK ); - aErrors.push_back(BasicError(pErrInf->GetErrorCode(), BasicErrorReason::OPENMGRSTREAM)); + aErrors.push_back(BasicError(*pErrInf, BasicErrorReason::OPENMGRSTREAM)); // and it proceeds ... } xManagerStream->Seek( nBasicEndOff+1 ); // +1: 0x00 as separator @@ -825,7 +825,7 @@ void BasicManager::LoadOldBasicManager( SotStorage& rStorage ) else { StringErrorInfo* pErrInf = new StringErrorInfo( ERRCODE_BASMGR_LIBLOAD, aStorName, ERRCODE_BUTTON_OK ); - aErrors.push_back(BasicError(pErrInf->GetErrorCode(), BasicErrorReason::STORAGENOTFOUND)); + aErrors.push_back(BasicError(*pErrInf, BasicErrorReason::STORAGENOTFOUND)); } } } @@ -908,7 +908,7 @@ bool BasicManager::ImpLoadLibrary( BasicLibInfo* pLibInfo, SotStorage* pCurStora if ( !xBasicStorage.is() || xBasicStorage->GetError() ) { StringErrorInfo* pErrInf = new StringErrorInfo( ERRCODE_BASMGR_MGROPEN, xStorage->GetName(), ERRCODE_BUTTON_OK ); - aErrors.push_back(BasicError(pErrInf->GetErrorCode(), BasicErrorReason::OPENLIBSTORAGE)); + aErrors.push_back(BasicError(*pErrInf, BasicErrorReason::OPENLIBSTORAGE)); } else { @@ -917,7 +917,7 @@ bool BasicManager::ImpLoadLibrary( BasicLibInfo* pLibInfo, SotStorage* pCurStora if ( !xBasicStream.is() || xBasicStream->GetError() ) { StringErrorInfo* pErrInf = new StringErrorInfo( ERRCODE_BASMGR_LIBLOAD , pLibInfo->GetLibName(), ERRCODE_BUTTON_OK ); - aErrors.push_back(BasicError(pErrInf->GetErrorCode(), BasicErrorReason::OPENLIBSTREAM)); + aErrors.push_back(BasicError(*pErrInf, BasicErrorReason::OPENLIBSTREAM)); } else { @@ -940,7 +940,7 @@ bool BasicManager::ImpLoadLibrary( BasicLibInfo* pLibInfo, SotStorage* pCurStora if ( !bLoaded ) { StringErrorInfo* pErrInf = new StringErrorInfo( ERRCODE_BASMGR_LIBLOAD, pLibInfo->GetLibName(), ERRCODE_BUTTON_OK ); - aErrors.push_back(BasicError(pErrInf->GetErrorCode(), BasicErrorReason::BASICLOADERROR)); + aErrors.push_back(BasicError(*pErrInf, BasicErrorReason::BASICLOADERROR)); } else { @@ -1124,7 +1124,7 @@ bool BasicManager::RemoveLib( sal_uInt16 nLib, bool bDelBasicFromStorage ) if( !nLib || nLib < mpImpl->aLibs.size() ) { StringErrorInfo* pErrInf = new StringErrorInfo( ERRCODE_BASMGR_REMOVELIB, OUString(), ERRCODE_BUTTON_OK ); - aErrors.push_back(BasicError(pErrInf->GetErrorCode(), BasicErrorReason::STDLIB)); + aErrors.push_back(BasicError(*pErrInf, BasicErrorReason::STDLIB)); return false; } @@ -1160,7 +1160,7 @@ bool BasicManager::RemoveLib( sal_uInt16 nLib, bool bDelBasicFromStorage ) if ( !xBasicStorage.is() || xBasicStorage->GetError() ) { StringErrorInfo* pErrInf = new StringErrorInfo( ERRCODE_BASMGR_REMOVELIB, OUString(), ERRCODE_BUTTON_OK ); - aErrors.push_back(BasicError(pErrInf->GetErrorCode(), BasicErrorReason::OPENLIBSTORAGE)); + aErrors.push_back(BasicError(*pErrInf, BasicErrorReason::OPENLIBSTORAGE)); } else if (xBasicStorage->IsStream((*itLibInfo)->GetLibName())) { @@ -1295,7 +1295,7 @@ bool BasicManager::LoadLib( sal_uInt16 nLib ) else { StringErrorInfo* pErrInf = new StringErrorInfo( ERRCODE_BASMGR_LIBLOAD, OUString(), ERRCODE_BUTTON_OK ); - aErrors.push_back(BasicError(pErrInf->GetErrorCode(), BasicErrorReason::LIBNOTFOUND)); + aErrors.push_back(BasicError(*pErrInf, BasicErrorReason::LIBNOTFOUND)); } return bDone; } |