Skip to content

Commit 99b4fff

Browse files
msullivanbrson
authored andcommitted
Properly handle the case where src==dst but we have to allocate a new vector.
1 parent ec80918 commit 99b4fff

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/rt/rust_upcall.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -480,7 +480,7 @@ upcall_vec_append(rust_task *task, type_desc *t, type_desc *elem_t,
480480

481481
// If src and dst are the same (due to "v += v"), then dst getting
482482
// resized causes src to move as well.
483-
if (dst == src) {
483+
if (dst == src && !need_copy) {
484484
src = new_vec;
485485
}
486486

0 commit comments

Comments
 (0)