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:
@@ -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)) {
|
||||
/*
|
||||
|
||||
@@ -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) {
|
||||
|
||||
Reference in New Issue
Block a user