diff options
author | dim <dim@FreeBSD.org> | 2014-03-05 22:43:30 +0000 |
---|---|---|
committer | dim <dim@FreeBSD.org> | 2014-03-05 22:43:30 +0000 |
commit | 813e459619ed05280f3f1d53a830d2f7e2df0d3c (patch) | |
tree | 61d32a9d52b01c0df3a432ca4ad7a4f522e74c01 /contrib/llvm | |
parent | dddd70a1124ebe8b0f3bb3c42ee2e5be9372f802 (diff) | |
download | FreeBSD-src-813e459619ed05280f3f1d53a830d2f7e2df0d3c.zip FreeBSD-src-813e459619ed05280f3f1d53a830d2f7e2df0d3c.tar.gz |
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
Diffstat (limited to 'contrib/llvm')
-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 cfb2d62..2f8a17a 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); |