Skip to content

Commit fd10636

Browse files
committed
[Concurrency][Task Locals] Fix missing flag setting on next pointer
1 parent 77d828d commit fd10636

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

include/swift/ABI/Task.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -300,15 +300,15 @@ class AsyncTask : public HeapObject, public Job {
300300
// therefore skip also skip pointing to that parent and point
301301
// to whichever parent it was pointing to as well, it may be its
302302
// immediate parent, or some super-parent.
303-
item->next = reinterpret_cast<uintptr_t>(parentHead->getNext());
303+
item->next = reinterpret_cast<uintptr_t>(parentHead->getNext()) |
304304
static_cast<uintptr_t>(NextLinkType::IsParent);
305305
break;
306306
case NextLinkType::IsNext:
307307
assert(false && "empty taskValue head in parent task, yet parent's 'head' is `IsNext`, "
308308
"this should not happen, as it implies the parent must have stored some value.");
309309
break;
310310
case NextLinkType::IsTerminal:
311-
item->next = reinterpret_cast<uintptr_t>(parentHead->getNext());
311+
item->next = reinterpret_cast<uintptr_t>(parentHead->getNext()) |
312312
static_cast<uintptr_t>(NextLinkType::IsTerminal);
313313
break;
314314
}

0 commit comments

Comments
 (0)