summaryrefslogtreecommitdiffstats
path: root/nsprpub/pr/src/misc/prthinfo.c
diff options
context:
space:
mode:
authorwolfbeast <mcwerewolf@wolfbeast.com>2020-01-02 21:01:38 +0100
committerwolfbeast <mcwerewolf@wolfbeast.com>2020-01-02 21:01:38 +0100
commitf7d30133221896638f7bf4f66c504255c4b14f48 (patch)
tree5f3e07a049f388a3a309a615b8884318f6668a98 /nsprpub/pr/src/misc/prthinfo.c
parent26b297510a11758727438df4669357a2a2bc42ce (diff)
downloadUXP-f7d30133221896638f7bf4f66c504255c4b14f48.tar
UXP-f7d30133221896638f7bf4f66c504255c4b14f48.tar.gz
UXP-f7d30133221896638f7bf4f66c504255c4b14f48.tar.lz
UXP-f7d30133221896638f7bf4f66c504255c4b14f48.tar.xz
UXP-f7d30133221896638f7bf4f66c504255c4b14f48.zip
Issue #1338 - Part 1: Update NSPR to 4.24
Diffstat (limited to 'nsprpub/pr/src/misc/prthinfo.c')
-rw-r--r--nsprpub/pr/src/misc/prthinfo.c29
1 files changed, 17 insertions, 12 deletions
diff --git a/nsprpub/pr/src/misc/prthinfo.c b/nsprpub/pr/src/misc/prthinfo.c
index 2477899c3..14602df0b 100644
--- a/nsprpub/pr/src/misc/prthinfo.c
+++ b/nsprpub/pr/src/misc/prthinfo.c
@@ -32,8 +32,9 @@ PR_ThreadScanStackPointers(PRThread* t,
*/
p0 = _MD_HomeGCRegisters(t, t == current, &n);
status = scanFun(t, (void**)p0, n, scanClosure);
- if (status != PR_SUCCESS)
+ if (status != PR_SUCCESS) {
return status;
+ }
/* Scan the C stack for pointers into the GC heap */
#if defined(XP_PC) && defined(WIN16)
@@ -86,7 +87,7 @@ PR_ThreadScanStackPointers(PRThread* t,
{
prword_t scan;
prword_t limit;
-
+
scan = (prword_t) sp;
limit = (prword_t) esp;
while (scan < limit) {
@@ -94,16 +95,18 @@ PR_ThreadScanStackPointers(PRThread* t,
test = *((prword_t **)scan);
status = scanFun(t, (void**)&test, 1, scanClosure);
- if (status != PR_SUCCESS)
+ if (status != PR_SUCCESS) {
return status;
+ }
scan += sizeof(char);
}
}
#else
if (sp < esp) {
status = scanFun(t, (void**)sp, esp - sp, scanClosure);
- if (status != PR_SUCCESS)
+ if (status != PR_SUCCESS) {
return status;
+ }
}
#endif
@@ -114,17 +117,19 @@ PR_ThreadScanStackPointers(PRThread* t,
** will be collected
*/
status = scanFun(t, (void**)&t->environment, 1, scanClosure);
- if (status != PR_SUCCESS)
+ if (status != PR_SUCCESS) {
return status;
+ }
/* if thread is not allocated on stack, this is redundant. */
ptd = t->privateData;
for (index = 0; index < t->tpdLength; index++, ptd++) {
status = scanFun(t, (void**)ptd, 1, scanClosure);
- if (status != PR_SUCCESS)
+ if (status != PR_SUCCESS) {
return status;
+ }
}
-
+
return PR_SUCCESS;
}
@@ -173,9 +178,9 @@ PR_GetStackSpaceLeft(PRThread* t)
sp = (PRWord*) PR_GetSP(t);
esp = (PRWord*) t->stack->stackTop;
- PR_ASSERT((t->stack->stackSize == 0) ||
- ((sp > (PRWord*)t->stack->stackBottom) &&
- (sp <= (PRWord*)t->stack->stackTop)));
+ PR_ASSERT((t->stack->stackSize == 0) ||
+ ((sp > (PRWord*)t->stack->stackBottom) &&
+ (sp <= (PRWord*)t->stack->stackTop)));
}
#else /* ! WIN16 */
#ifdef HAVE_STACK_GROWING_UP
@@ -197,8 +202,8 @@ PR_GetStackSpaceLeft(PRThread* t)
}
esp = (PRWord*) t->stack->stackTop;
if (t->stack->stackSize) {
- PR_ASSERT((sp > (PRWord*)t->stack->stackBottom) &&
- (sp < (PRWord*)t->stack->stackTop));
+ PR_ASSERT((sp > (PRWord*)t->stack->stackBottom) &&
+ (sp < (PRWord*)t->stack->stackTop));
}
#endif /* ! HAVE_STACK_GROWING_UP */
#endif /* ! WIN16 */