diff --git a/base/src/nsDeque.cpp b/base/src/nsDeque.cpp index bd573d00aab..7641099e2fb 100644 --- a/base/src/nsDeque.cpp +++ b/base/src/nsDeque.cpp @@ -160,8 +160,8 @@ void* nsDeque::PopBack(void) { int offset=mOrigin+mSize; if(offset>=mCapacity) offset-=mCapacity; - result=mData[offset]; - mData[offset]=0; + result=mData[offset-1]; + mData[offset-1]=0; mSize--; if(0==mSize) mOrigin=0; diff --git a/xpcom/ds/nsDeque.cpp b/xpcom/ds/nsDeque.cpp index bd573d00aab..7641099e2fb 100644 --- a/xpcom/ds/nsDeque.cpp +++ b/xpcom/ds/nsDeque.cpp @@ -160,8 +160,8 @@ void* nsDeque::PopBack(void) { int offset=mOrigin+mSize; if(offset>=mCapacity) offset-=mCapacity; - result=mData[offset]; - mData[offset]=0; + result=mData[offset-1]; + mData[offset-1]=0; mSize--; if(0==mSize) mOrigin=0;