Commit 98fef9ad authored by Matthieu Martin's avatar Matthieu Martin Committed by Facebook Github Bot

Fix shallow copy segfault

Summary: Mishandling of parent end boundary.

Reviewed By: djwatson

Differential Revision: D9119716

fbshipit-source-id: c186e5acffdedc77577e1ab3a7b5876a6423e0f4
parent 4875d385
...@@ -214,13 +214,19 @@ RequestContext::setShallowCopyContext() { ...@@ -214,13 +214,19 @@ RequestContext::setShallowCopyContext() {
auto pend = parentLock->callbackData_.end(); auto pend = parentLock->callbackData_.end();
auto citer = childLock->callbackData_.begin(); auto citer = childLock->callbackData_.begin();
auto cend = childLock->callbackData_.end(); auto cend = childLock->callbackData_.end();
while (piter != pend || citer != cend) { while (true) {
if (piter == pend || *citer < *piter) { if (piter == pend) {
if (citer == cend) {
break;
}
(*citer)->onUnset(); (*citer)->onUnset();
++citer; ++citer;
} else if (citer == cend || *piter < *citer) { } else if (citer == cend || *piter < *citer) {
(*piter)->onSet(); (*piter)->onSet();
++piter; ++piter;
} else if (*citer < *piter) {
(*citer)->onUnset();
++citer;
} else { } else {
DCHECK(*piter == *citer); DCHECK(*piter == *citer);
++piter; ++piter;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment