Commit 88763450 authored by Kenton Varda's avatar Kenton Varda

Partial cherry-pick of 1859b718 to fix bug in List::adopt.

parent 3328792f
...@@ -386,7 +386,7 @@ struct List<List<T>, Kind::LIST> { ...@@ -386,7 +386,7 @@ struct List<List<T>, Kind::LIST> {
} }
inline void adopt(uint index, Orphan<T>&& value) { inline void adopt(uint index, Orphan<T>&& value) {
KJ_IREQUIRE(index < size()); KJ_IREQUIRE(index < size());
builder.getPointerElement(index * ELEMENTS).adopt(kj::mv(value)); builder.getPointerElement(index * ELEMENTS).adopt(kj::mv(value.builder));
} }
inline Orphan<T> disown(uint index) { inline Orphan<T> disown(uint index) {
KJ_IREQUIRE(index < size()); KJ_IREQUIRE(index < size());
...@@ -484,7 +484,7 @@ struct List<T, Kind::BLOB> { ...@@ -484,7 +484,7 @@ struct List<T, Kind::BLOB> {
} }
inline void adopt(uint index, Orphan<T>&& value) { inline void adopt(uint index, Orphan<T>&& value) {
KJ_IREQUIRE(index < size()); KJ_IREQUIRE(index < size());
builder.getPointerElement(index * ELEMENTS).adopt(kj::mv(value)); builder.getPointerElement(index * ELEMENTS).adopt(kj::mv(value.builder));
} }
inline Orphan<T> disown(uint index) { inline Orphan<T> disown(uint index) {
KJ_IREQUIRE(index < size()); KJ_IREQUIRE(index < size());
......
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