Bug 935568, update Mozilla to NSPR 4.10.2 RTM, r=wtc/me
authorKai Engert <kaie@kuix.de>
Sat, 09 Nov 2013 11:18:00 +0100
changeset 154273 31d1b55d9c9bb6c309e2c83895b62c9401fb66a4
parent 154272 db2f368bf99991579f65e7494280d363d526ad90
child 154274 53562d5d7df2ae069ec17df44ffeb9fb3fe8e2c6
push id25634
push usercbook@mozilla.com
push dateMon, 11 Nov 2013 07:54:04 +0000
treeherdermozilla-central@86afe33114e7 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewerswtc, me
bugs935568
milestone28.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 935568, update Mozilla to NSPR 4.10.2 RTM, r=wtc/me
nsprpub/TAG-INFO
nsprpub/config/prdepend.h
nsprpub/lib/ds/plarena.c
nsprpub/pr/include/prinit.h
nsprpub/pr/src/pthreads/ptio.c
--- a/nsprpub/TAG-INFO
+++ b/nsprpub/TAG-INFO
@@ -1,1 +1,1 @@
-NSPR_4_10_2_BETA1
+NSPR_4_10_2_RTM
--- a/nsprpub/config/prdepend.h
+++ b/nsprpub/config/prdepend.h
@@ -5,8 +5,9 @@
 
 /*
  * A dummy header file that is a dependency for all the object files.
  * Used to force a full recompilation of NSPR in Mozilla's Tinderbox
  * depend builds.  See comments in rules.mk.
  */
 
 #error "Do not include this header file."
+
--- a/nsprpub/lib/ds/plarena.c
+++ b/nsprpub/lib/ds/plarena.c
@@ -148,17 +148,17 @@ PR_IMPLEMENT(void *) PL_ArenaAllocate(PL
     PR_ASSERT((nb & pool->mask) == 0);
     
     nb = (PRUword)PL_ARENA_ALIGN(pool, nb); /* force alignment */
 
     /* attempt to allocate from arenas at pool->current */
     {
         a = pool->current;
         do {
-            if ( a->avail +nb <= a->limit )  {
+            if ( nb <= a->limit - a->avail )  {
                 pool->current = a;
                 rp = (char *)a->avail;
                 a->avail += nb;
                 return rp;
             }
         } while( NULL != (a = a->next) );
     }
 
@@ -166,17 +166,17 @@ PR_IMPLEMENT(void *) PL_ArenaAllocate(PL
     {
         PLArena *p; /* previous pointer, for unlinking from freelist */
 
         /* lock the arena_freelist. Make access to the freelist MT-Safe */
         if ( PR_FAILURE == LockArena())
             return(0);
 
         for ( a = arena_freelist, p = NULL; a != NULL ; p = a, a = a->next ) {
-            if ( a->base +nb <= a->limit )  {
+            if ( nb <= a->limit - a->base )  {
                 if ( p == NULL )
                     arena_freelist = a->next;
                 else
                     p->next = a->next;
                 UnlockArena();
                 a->avail = a->base;
                 rp = (char *)a->avail;
                 a->avail += nb;
@@ -191,18 +191,22 @@ PR_IMPLEMENT(void *) PL_ArenaAllocate(PL
             }
         }
         UnlockArena();
     }
 
     /* attempt to allocate from the heap */ 
     {  
         PRUint32 sz = PR_MAX(pool->arenasize, nb);
-        sz += sizeof *a + pool->mask;  /* header and alignment slop */
-        a = (PLArena*)PR_MALLOC(sz);
+        if (PR_UINT32_MAX - sz < sizeof *a + pool->mask) {
+            a = NULL;
+        } else {
+            sz += sizeof *a + pool->mask;  /* header and alignment slop */
+            a = (PLArena*)PR_MALLOC(sz);
+        }
         if ( NULL != a )  {
             a->limit = (PRUword)a + sz;
             a->base = a->avail = (PRUword)PL_ARENA_ALIGN(pool, a + 1);
             PL_MAKE_MEM_NOACCESS((void*)a->avail, a->limit - a->avail);
             rp = (char *)a->avail;
             a->avail += nb;
             /* the newly allocated arena is linked after pool->current 
             *  and becomes pool->current */
--- a/nsprpub/pr/include/prinit.h
+++ b/nsprpub/pr/include/prinit.h
@@ -26,21 +26,21 @@ PR_BEGIN_EXTERN_C
 /*
 ** NSPR's version is used to determine the likelihood that the version you
 ** used to build your component is anywhere close to being compatible with
 ** what is in the underlying library.
 **
 ** The format of the version string is
 **     "<major version>.<minor version>[.<patch level>] [<Beta>]"
 */
-#define PR_VERSION  "4.10.2 Beta"
+#define PR_VERSION  "4.10.2"
 #define PR_VMAJOR   4
 #define PR_VMINOR   10
 #define PR_VPATCH   2
-#define PR_BETA     PR_TRUE
+#define PR_BETA     PR_FALSE
 
 /*
 ** PRVersionCheck
 **
 ** The basic signature of the function that is called to provide version
 ** checking. The result will be a boolean that indicates the likelihood
 ** that the underling library will perform as the caller expects.
 **
--- a/nsprpub/pr/src/pthreads/ptio.c
+++ b/nsprpub/pr/src/pthreads/ptio.c
@@ -4581,17 +4581,17 @@ PR_IMPLEMENT(PRFileDesc*) PR_ImportTCPSo
 }  /* PR_ImportTCPSocket */
 
 PR_IMPLEMENT(PRFileDesc*) PR_ImportUDPSocket(PRInt32 osfd)
 {
     PRFileDesc *fd;
 
     if (!_pr_initialized) _PR_ImplicitInitialization();
     fd = pt_SetMethods(osfd, PR_DESC_SOCKET_UDP, PR_FALSE, PR_TRUE);
-    if (NULL != fd) close(osfd);
+    if (NULL == fd) close(osfd);
     return fd;
 }  /* PR_ImportUDPSocket */
 
 PR_IMPLEMENT(PRFileDesc*) PR_CreateSocketPollFd(PRInt32 osfd)
 {
     PRFileDesc *fd;
 
     if (!_pr_initialized) _PR_ImplicitInitialization();