Fix based on rogerl's keen analysis to ancient circa 1995 bug (19165). ANDREAS_URL_BASE NSIFILE_01192000_BASE NSIFILE_01202000_BASE NSPRPUB_RELEASE_4_0_BASE SeaMonkey_M13_BASE
authorbrendan%mozilla.org
Wed, 19 Jan 2000 03:53:19 +0000
changeset 1054 483e317ac4c046076c87b4278ab1b34ebe4d11f1
parent 1053 ce0e23d6c64e7ec56f3c502dcbc4849d9050173d
child 1055 79a7a4d27bb3e6304a0b39630bd6700a66a1df07
child 1056 61e422c3422e49d4ebd778bf28fca5bf93fb6a69
child 1057 3bb0828d5389f2f3d283e52b0354b34ceecb01fd
child 1058 cfd82a552442ddba9fd3523fc88090fee6d6951f
child 1059 7a37916faf934ca16aa08c4f407be0a0d48f8040
child 1064 97046d05458306ca4c9d008aa1bbd9bb4545ad68
child 1195 6a2e556fb4f314c8b5fbb88dd493ce802104e686
child 1196 aa34eb64f82b350690082c2d041b05f5b854d419
push idunknown
push userunknown
push dateunknown
bugs19165
Fix based on rogerl's keen analysis to ancient circa 1995 bug (19165).
lib/ds/plarena.c
lib/ds/plarena.h
--- a/lib/ds/plarena.c
+++ b/lib/ds/plarena.c
@@ -213,17 +213,17 @@ static void FreeArenaList(PLArenaPool *p
     pool->current = head;
 }
 
 PR_IMPLEMENT(void) PL_ArenaRelease(PLArenaPool *pool, char *mark)
 {
     PLArena *a;
 
     for (a = pool->first.next; a; a = a->next) {
-        if (PR_UPTRDIFF(mark, a) < PR_UPTRDIFF(a->avail, a)) {
+        if (PR_UPTRDIFF(mark, a->base) < PR_UPTRDIFF(a->avail, a->base)) {
             a->avail = (PRUword)PL_ARENA_ALIGN(pool, mark);
             FreeArenaList(pool, a, PR_TRUE);
             return;
         }
     }
 }
 
 PR_IMPLEMENT(void) PL_FreeArenaPool(PLArenaPool *pool)
--- a/lib/ds/plarena.h
+++ b/lib/ds/plarena.h
@@ -129,17 +129,17 @@ struct PLArenaPool {
 #define PL_CLEAR_UNUSED(a)
 #define PL_CLEAR_ARENA(a)
 #endif
 
 #define PL_ARENA_RELEASE(pool, mark) \
     PR_BEGIN_MACRO \
         char *_m = (char *)(mark); \
         PLArena *_a = (pool)->current; \
-        if (PR_UPTRDIFF(_m, _a) <= PR_UPTRDIFF(_a->avail, _a)) { \
+        if (PR_UPTRDIFF(_m, _a->base) <= PR_UPTRDIFF(_a->avail, _a->base)) { \
             _a->avail = (PRUword)PL_ARENA_ALIGN(pool, _m); \
             PL_CLEAR_UNUSED(_a); \
             PL_ArenaCountRetract(pool, _m); \
         } else { \
             PL_ArenaRelease(pool, _m); \
         } \
         PL_ArenaCountRelease(pool, _m); \
     PR_END_MACRO