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() {
auto pend = parentLock->callbackData_.end();
auto citer = childLock->callbackData_.begin();
auto cend = childLock->callbackData_.end();
while (piter != pend || citer != cend) {
if (piter == pend || *citer < *piter) {
while (true) {
if (piter == pend) {
if (citer == cend) {
break;
}
(*citer)->onUnset();
++citer;
} else if (citer == cend || *piter < *citer) {
(*piter)->onSet();
++piter;
} else if (*citer < *piter) {
(*citer)->onUnset();
++citer;
} else {
DCHECK(*piter == *citer);
++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