Skip to content
This repository has been archived by the owner on Aug 4, 2022. It is now read-only.

Commit

Permalink
Update NSPR to NSPR_4_10_7_BETA3 to fix bug 1034415 and bug 979278
Browse files Browse the repository at this point in the history
  • Loading branch information
ehsan committed Jul 7, 2014
1 parent f4b2aad commit 593a21b
Show file tree
Hide file tree
Showing 5 changed files with 11 additions and 12 deletions.
2 changes: 1 addition & 1 deletion nsprpub/TAG-INFO
Original file line number Diff line number Diff line change
@@ -1 +1 @@
NSPR_4_10_7_BETA2
NSPR_4_10_7_BETA3
1 change: 0 additions & 1 deletion nsprpub/config/prdepend.h
Original file line number Diff line number Diff line change
Expand Up @@ -10,4 +10,3 @@
*/

#error "Do not include this header file."

2 changes: 0 additions & 2 deletions nsprpub/configure
Original file line number Diff line number Diff line change
Expand Up @@ -7099,8 +7099,6 @@ tools are selected during the Xcode/Developer Tools installation." "$LINENO" 5
# Use temp file for windres (bug 213281)
RCFLAGS='-O coff --use-temp-file'
else
CC=cl
CXX=cl
LD=link
AR='lib -NOLOGO -OUT:"$@"'
AR_FLAGS=
Expand Down
2 changes: 0 additions & 2 deletions nsprpub/configure.in
Original file line number Diff line number Diff line change
Expand Up @@ -1915,8 +1915,6 @@ tools are selected during the Xcode/Developer Tools installation.])
# Use temp file for windres (bug 213281)
RCFLAGS='-O coff --use-temp-file'
else
CC=cl
CXX=cl
LD=link
AR='lib -NOLOGO -OUT:"$@"'
AR_FLAGS=
Expand Down
16 changes: 10 additions & 6 deletions nsprpub/pr/src/threads/prtpd.c
Original file line number Diff line number Diff line change
Expand Up @@ -130,20 +130,20 @@ PR_IMPLEMENT(PRStatus) PR_NewThreadPrivateIndex(
** destructor function and a non-NULL per-thread-private data value,
** the destructor function is invoked.
**
** This can return PR_FAILURE if index is invalid (ie., beyond the current
** high water mark) or memory is insufficient to allocate an exanded vector.
** This can return PR_FAILURE if index is invalid (ie., beyond the limit
** on the TPD slots) or memory is insufficient to allocate an expanded
** vector.
*/

PR_IMPLEMENT(PRStatus) PR_SetThreadPrivate(PRUintn index, void *priv)
{
PRThread *self = PR_GetCurrentThread();

/*
** The index being set might not have a sufficient vector in this
** thread. But if the index has been allocated, it's okay to go
** ahead and extend this one now.
** To improve performance, we don't check if the index has been
** allocated.
*/
if ((index >= _PR_TPD_LIMIT) || (index >= _pr_tpd_highwater))
if (index >= _PR_TPD_LIMIT)
{
PR_SetError(PR_TPD_RANGE_ERROR, 0);
return PR_FAILURE;
Expand All @@ -152,6 +152,10 @@ PR_IMPLEMENT(PRStatus) PR_SetThreadPrivate(PRUintn index, void *priv)
PR_ASSERT(((NULL == self->privateData) && (0 == self->tpdLength))
|| ((NULL != self->privateData) && (0 != self->tpdLength)));

/*
** If this thread does not have a sufficient vector for the index
** being set, go ahead and extend this vector now.
*/
if ((NULL == self->privateData) || (self->tpdLength <= index))
{
void *extension = PR_CALLOC(_pr_tpd_length * sizeof(void*));
Expand Down

0 comments on commit 593a21b

Please sign in to comment.