File tree Expand file tree Collapse file tree 2 files changed +10
-1
lines changed Expand file tree Collapse file tree 2 files changed +10
-1
lines changed Original file line number Diff line number Diff line change @@ -321,6 +321,8 @@ class RecordContext {
321
321
322
322
RecordContext (APIRecord::RecordKind Kind) : Kind(Kind) {}
323
323
324
+ // / Append \p Other children chain into ours and empty out Other's record
325
+ // / chain.
324
326
void stealRecordChain (RecordContext &Other);
325
327
326
328
APIRecord::RecordKind getKind () const { return Kind; }
Original file line number Diff line number Diff line change @@ -55,8 +55,15 @@ RecordContext *APIRecord::castToRecordContext(const APIRecord *Record) {
55
55
}
56
56
57
57
void RecordContext::stealRecordChain (RecordContext &Other) {
58
- First = Other.First ;
58
+ // If we don't have an empty chain append Other's chain into ours.
59
+ if (First)
60
+ Last->NextInContext = Other.First ;
61
+ else
62
+ First = Other.First ;
63
+
59
64
Last = Other.Last ;
65
+
66
+ // Delete Other's chain to ensure we don't accidentally traverse it.
60
67
Other.First = nullptr ;
61
68
Other.Last = nullptr ;
62
69
}
You can’t perform that action at this time.
0 commit comments