Bug 935568, update to 4.10.2 RTM, r=wtc/brian, a=lsblakk
authorKai Engert <kaie@kuix.de>
Mon, 11 Nov 2013 19:50:15 +0100
changeset 166460 1368e2ac4c570a1ce2bfe91ae16b979a624e4d58
parent 166459 f80056afc7f46fd56bdbdfd474dfd017e7440c2a
child 166461 8ec63d52437e823cf426101fb1b313dff4aaa647
push id3066
push userakeybl@mozilla.com
push dateMon, 09 Dec 2013 19:58:46 +0000
treeherdermozilla-beta@a31a0dce83aa [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewerswtc, brian, lsblakk
bugs935568
milestone27.0a2
Bug 935568, update to 4.10.2 RTM, r=wtc/brian, a=lsblakk
configure.in
nsprpub/TAG-INFO
nsprpub/config/prdepend.h
nsprpub/lib/ds/plarena.c
nsprpub/pr/include/prinit.h
nsprpub/pr/src/pthreads/ptio.c
--- a/configure.in
+++ b/configure.in
@@ -3558,17 +3558,17 @@ dnl ====================================
 dnl = If NSPR was not detected in the system,
 dnl = use the one in the source tree (mozilla/nsprpub)
 dnl ========================================================
 MOZ_ARG_WITH_BOOL(system-nspr,
 [  --with-system-nspr      Use system installed NSPR],
     _USE_SYSTEM_NSPR=1 )
 
 if test -n "$_USE_SYSTEM_NSPR"; then
-    AM_PATH_NSPR(4.9.6, [MOZ_NATIVE_NSPR=1], [AC_MSG_ERROR([your don't have NSPR installed or your version is too old])])
+    AM_PATH_NSPR(4.10.2, [MOZ_NATIVE_NSPR=1], [AC_MSG_ERROR([your don't have NSPR installed or your version is too old])])
 fi
 
 if test -n "$MOZ_NATIVE_NSPR"; then
     _SAVE_CFLAGS=$CFLAGS
     CFLAGS="$CFLAGS $NSPR_CFLAGS"
     AC_TRY_COMPILE([#include "prtypes.h"],
                 [#ifndef PR_STATIC_ASSERT
                  #error PR_STATIC_ASSERT not defined or requires including prtypes.h
--- 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();