[Libreoffice-commits] core.git: 2 commits - basic/source compilerplugins/clang
Stephan Bergmann
sbergman at redhat.com
Fri Aug 14 04:19:19 PDT 2015
basic/source/classes/sbxmod.cxx | 7 +------
compilerplugins/clang/defaultparams.cxx | 8 ++++++--
2 files changed, 7 insertions(+), 8 deletions(-)
New commits:
commit 65aa35fbeeb837c229209daf558da74d8237dab5
Author: Stephan Bergmann <sbergman at redhat.com>
Date: Fri Aug 14 12:19:55 2015 +0200
Don't trigger assert in clang::ParmVarDecl::getDefaultArg
Change-Id: Ica385b513d87d639496ac470da296e871b093ab4
diff --git a/compilerplugins/clang/defaultparams.cxx b/compilerplugins/clang/defaultparams.cxx
index e71d89a..fc63b35 100644
--- a/compilerplugins/clang/defaultparams.cxx
+++ b/compilerplugins/clang/defaultparams.cxx
@@ -52,9 +52,13 @@ bool DefaultParams::VisitCallExpr(CallExpr * callExpr) {
if (isa<UnaryExprOrTypeTraitExpr>(arg))
return true;
const ParmVarDecl* parmVarDecl = functionDecl->getParamDecl(i);
+ if (!parmVarDecl->hasDefaultArg()
+ || parmVarDecl->hasUninstantiatedDefaultArg())
+ {
+ return true;
+ }
const Expr* defaultArgExpr = parmVarDecl->getDefaultArg();
- if (parmVarDecl->hasDefaultArg() &&
- defaultArgExpr &&
+ if (defaultArgExpr &&
defaultArgExpr->getType()->isIntegralType(compiler.getASTContext()))
{
APSInt x1, x2;
commit 9d094b9f0a05d2ea62181201efb8f9e46ecfc8f1
Author: Stephan Bergmann <sbergman at redhat.com>
Date: Fri Aug 14 11:45:09 2015 +0200
tdf#92446: Revert apparently bogus attempt at fixing a memory leak
6b4c596b01039324cfe78f38c4e3ffb9080bcd34 "Fix memory leak for BASIC sub (as well
as void function)," from just looking at the few lines of code in isolation, and
their revision history, looked like a plausible and effective approach to fix
the leaks reported by CppunitTest_basci_vba when run under lsan.
However, tdf#92446 indicates that that innocent-looking change had rather dire
consequences. So revert it and leave a fix for the memory leak to somebody who
actually understands all this code.
Change-Id: Ic81b1c14a1cfb07c6ec4415cc26b2f826adbc8ca
diff --git a/basic/source/classes/sbxmod.cxx b/basic/source/classes/sbxmod.cxx
index 79498cd..698d55e 100644
--- a/basic/source/classes/sbxmod.cxx
+++ b/basic/source/classes/sbxmod.cxx
@@ -2140,13 +2140,8 @@ void SbMethod::Broadcast( sal_uInt32 nHintId )
if( mpPar.Is() )
{
// Enregister this as element 0, but don't reset the parent!
- switch( GetType() ) {
- case SbxEMPTY:
- case SbxVOID:
- break;
- default:
+ if( GetType() != SbxVOID ) {
mpPar->PutDirect( pThisCopy, 0 );
- break;
}
SetParameters( NULL );
}
More information about the Libreoffice-commits
mailing list