summaryrefslogtreecommitdiff
path: root/tools
diff options
context:
space:
mode:
authorMichael Stahl <mstahl@redhat.com>2017-02-07 22:48:33 +0100
committerMichael Stahl <mstahl@redhat.com>2017-02-07 23:02:57 +0100
commit653e181fb831a04c2845d99f79f72454a88bb948 (patch)
tree3ec424e8c21f15573226f7f40eb9bd7e97f49107 /tools
parent32cae6a2eaa41568888df9c8fc5605debd8d704a (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 'tools')
-rw-r--r--tools/source/ref/errinf.cxx6
1 files changed, 3 insertions, 3 deletions
diff --git a/tools/source/ref/errinf.cxx b/tools/source/ref/errinf.cxx
index 539151c40583..4c3eb5209751 100644
--- a/tools/source/ref/errinf.cxx
+++ b/tools/source/ref/errinf.cxx
@@ -86,7 +86,7 @@ void DynamicErrorInfo_Impl::RegisterEDcr(DynamicErrorInfo *pDcr)
void DynamicErrorInfo_Impl::UnRegisterEDcr(DynamicErrorInfo const *pDcr)
{
DynamicErrorInfo **ppDcr = TheEDcrData::get().ppDcr;
- sal_uIntPtr lIdx = ((pDcr->GetErrorCode() & ERRCODE_DYNAMIC_MASK) >> ERRCODE_DYNAMIC_SHIFT) - 1;
+ sal_uIntPtr lIdx = (((sal_uIntPtr)(*pDcr) & ERRCODE_DYNAMIC_MASK) >> ERRCODE_DYNAMIC_SHIFT) - 1;
DBG_ASSERT(ppDcr[lIdx]==pDcr,"ErrHdl: Error nicht gefunden");
if(ppDcr[lIdx]==pDcr)
ppDcr[lIdx]=nullptr;
@@ -105,7 +105,7 @@ ErrorInfo *ErrorInfo::GetErrorInfo(sal_uIntPtr lId)
return new ErrorInfo(lId);
}
-sal_uIntPtr DynamicErrorInfo::GetErrorCode() const
+DynamicErrorInfo::operator sal_uIntPtr() const
{
return pImpl->lErrId;
}
@@ -127,7 +127,7 @@ ErrorInfo* DynamicErrorInfo_Impl::GetDynamicErrorInfo(sal_uIntPtr lId)
{
sal_uIntPtr lIdx = ((lId & ERRCODE_DYNAMIC_MASK)>>ERRCODE_DYNAMIC_SHIFT)-1;
DynamicErrorInfo* pDcr = TheEDcrData::get().ppDcr[lIdx];
- if(pDcr && pDcr->GetErrorCode()==lId)
+ if(pDcr && (sal_uIntPtr)(*pDcr)==lId)
return pDcr;
else
return new ErrorInfo(lId & ~ERRCODE_DYNAMIC_MASK);