diff options
author | Dimitry Andric <dim@FreeBSD.org> | 2014-03-05 22:43:30 +0000 |
---|---|---|
committer | Dimitry Andric <dim@FreeBSD.org> | 2014-03-05 22:43:30 +0000 |
commit | 689f150570a7a29a1ac478c0eaeb150f3d756945 (patch) | |
tree | 61d32a9d52b01c0df3a432ca4ad7a4f522e74c01 /contrib | |
parent | 256ea2aba95ea4323dc6b18307276cd7b5b5ac15 (diff) | |
download | src-689f150570a7a29a1ac478c0eaeb150f3d756945.tar.gz src-689f150570a7a29a1ac478c0eaeb150f3d756945.zip |
Pull in r203007 from upstream clang trunk:
Don't produce an alias between destructors with different calling conventions.
Fixes pr19007.
(Please note that is an LLVM PR identifier, not a FreeBSD one.)
This should fix Firefox and/or libxul crashes (due to problems with
regparm/stdcall calling conventions) on i386.
Reported by: multiple users on freebsd-current
PR: bin/187103
MFC after: 1 week
Notes
Notes:
svn path=/head/; revision=262809
Diffstat (limited to 'contrib')
-rw-r--r-- | contrib/llvm/tools/clang/lib/CodeGen/CGCXX.cpp | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/contrib/llvm/tools/clang/lib/CodeGen/CGCXX.cpp b/contrib/llvm/tools/clang/lib/CodeGen/CGCXX.cpp index cfb2d6291b8a..2f8a17afbcd1 100644 --- a/contrib/llvm/tools/clang/lib/CodeGen/CGCXX.cpp +++ b/contrib/llvm/tools/clang/lib/CodeGen/CGCXX.cpp @@ -92,7 +92,13 @@ bool CodeGenModule::TryEmitBaseDestructorAsAlias(const CXXDestructorDecl *D) { if (!ClassLayout.getBaseClassOffset(UniqueBase).isZero()) return true; + // Give up if the calling conventions don't match. We could update the call, + // but it is probably not worth it. const CXXDestructorDecl *BaseD = UniqueBase->getDestructor(); + if (BaseD->getType()->getAs<FunctionType>()->getCallConv() != + D->getType()->getAs<FunctionType>()->getCallConv()) + return true; + return TryEmitDefinitionAsAlias(GlobalDecl(D, Dtor_Base), GlobalDecl(BaseD, Dtor_Base), false); |