1
0
mirror of https://git.FreeBSD.org/ports.git synced 2024-12-01 01:17:02 +00:00

mail/thunderbird: fix runtime crashes on powerpc64*

Details in https://bugzilla.mozilla.org/show_bug.cgi?id=1690152

Approved by:	tier 2 blanket
This commit is contained in:
Piotr Kubaj 2021-02-03 04:07:02 +00:00
parent 8613b01d64
commit 9c317d3cc1
Notes: svn2git 2021-03-31 03:12:20 +00:00
svn path=/head/; revision=563867
2 changed files with 98 additions and 1 deletions

View File

@ -3,7 +3,7 @@
PORTNAME= thunderbird
DISTVERSION= 78.7.0
PORTREVISION= 1
PORTREVISION= 2
CATEGORIES= mail news net-im
MASTER_SITES= MOZILLA/${PORTNAME}/releases/${DISTVERSION}/source \
MOZILLA/${PORTNAME}/candidates/${DISTVERSION}-candidates/build2/source

View File

@ -0,0 +1,97 @@
# HG changeset patch
# User Cameron Kaiser <spectre@floodgap.com>
# Date 1612231460 0
# Node ID 579a66fd796690fb752485215b2edaa6167ebf16
# Parent a00504e040bfd34d01c74d478beb9d308ec085be
Bug 1690152 - on ppc64 properly skip parameter slots if we overflow GPRs while still having FPRs to burn. r=tcampbell
Differential Revision: https://phabricator.services.mozilla.com/D103724
diff --git a/xpcom/reflect/xptcall/md/unix/xptcinvoke_ppc64_linux.cpp b/xpcom/reflect/xptcall/md/unix/xptcinvoke_ppc64_linux.cpp
--- xpcom/reflect/xptcall/md/unix/xptcinvoke_ppc64_linux.cpp
+++ xpcom/reflect/xptcall/md/unix/xptcinvoke_ppc64_linux.cpp
@@ -86,27 +86,37 @@ extern "C" void invoke_copy_to_stack(uin
case nsXPTType::T_WCHAR: value = s->val.wc; break;
default: value = (uint64_t) s->val.p; break;
}
}
if (!s->IsIndirect() && s->type == nsXPTType::T_DOUBLE) {
if (nr_fpr < FPR_COUNT) {
fpregs[nr_fpr++] = s->val.d;
- nr_gpr++;
+ // Even if we have enough FPRs, still skip space in
+ // the parameter area if we ran out of placeholder GPRs.
+ if (nr_gpr < GPR_COUNT) {
+ nr_gpr++;
+ } else {
+ d++;
+ }
} else {
*((double *)d) = s->val.d;
d++;
}
}
else if (!s->IsIndirect() && s->type == nsXPTType::T_FLOAT) {
if (nr_fpr < FPR_COUNT) {
// Single-precision floats are passed in FPRs too.
fpregs[nr_fpr++] = s->val.f;
- nr_gpr++;
+ if (nr_gpr < GPR_COUNT) {
+ nr_gpr++;
+ } else {
+ d++;
+ }
} else {
#ifdef __LITTLE_ENDIAN__
*((float *)d) = s->val.f;
#else
// Big endian needs adjustment to point to the least
// significant word.
float* p = (float*)d;
p++;
diff --git a/xpcom/reflect/xptcall/md/unix/xptcstubs_ppc64_linux.cpp b/xpcom/reflect/xptcall/md/unix/xptcstubs_ppc64_linux.cpp
--- xpcom/reflect/xptcall/md/unix/xptcstubs_ppc64_linux.cpp
+++ xpcom/reflect/xptcall/md/unix/xptcstubs_ppc64_linux.cpp
@@ -98,27 +98,37 @@ PrepareAndDispatch(nsXPTCStubBase * self
nr_gpr++;
else
ap++;
}
if (!param.IsOut() && type == nsXPTType::T_DOUBLE) {
if (nr_fpr < FPR_COUNT) {
dp->val.d = fpregs[nr_fpr++];
- nr_gpr++;
+ // Even if we have enough FPRs, still skip space in
+ // the parameter area if we ran out of placeholder GPRs.
+ if (nr_gpr < GPR_COUNT) {
+ nr_gpr++;
+ } else {
+ ap++;
+ }
} else {
dp->val.d = *(double*)ap++;
}
continue;
}
if (!param.IsOut() && type == nsXPTType::T_FLOAT) {
if (nr_fpr < FPR_COUNT) {
// Single-precision floats are passed in FPRs too.
dp->val.f = (float)fpregs[nr_fpr++];
- nr_gpr++;
+ if (nr_gpr < GPR_COUNT) {
+ nr_gpr++;
+ } else {
+ ap++;
+ }
} else {
#ifdef __LITTLE_ENDIAN__
dp->val.f = *(float*)ap++;
#else
// Big endian needs adjustment to point to the least
// significant word.
float* p = (float*)ap;
p++;