Bug 794316: update the 'higher' pointer of the layer right below the new

top of the stack after the old top is popped. r=michal.novotny.
Modified Files:
	pr/src/io/prlayer.c pr/tests/pushtop.c


git-svn-id: svn://10.0.0.236/trunk@264273 18797224-902f-48f8-a5cc-f745e15eee43
This commit is contained in:
wtc%google.com
2012-09-28 14:21:22 +00:00
parent 53f002bd64
commit be1b47e59b
2 changed files with 15 additions and 0 deletions

View File

@@ -566,6 +566,10 @@ PR_IMPLEMENT(PRFileDesc*) PR_PopIOLayer(PRFileDesc *stack, PRDescIdentity id)
*stack = *extract;
*extract = copy;
stack->higher = NULL;
if (stack->lower) {
PR_ASSERT(stack->lower->higher == extract);
stack->lower->higher = stack;
}
} else if ((PR_IO_LAYER_HEAD == stack->identity) &&
(extract == stack->lower) && (extract->lower == NULL)) {
/*

View File

@@ -48,6 +48,17 @@ int main()
top = PR_PopIOLayer(fd, topId);
top->dtor(top);
middle = fd;
bottom = middle->lower;
/* Verify that the higher pointer is correct. */
if (bottom->higher != middle) {
fprintf(stderr, "bottom->higher is wrong\n");
fprintf(stderr, "FAILED\n");
exit(1);
}
middle = PR_PopIOLayer(fd, middleId);
middle->dtor(middle);
if (fd->identity != bottomId) {