about summary refs log tree commit diff
path: root/src/rt/rust_upcall.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/rt/rust_upcall.cpp')
-rw-r--r--src/rt/rust_upcall.cpp5
1 files changed, 4 insertions, 1 deletions
diff --git a/src/rt/rust_upcall.cpp b/src/rt/rust_upcall.cpp
index 9742b22af78..ebf81faf3ac 100644
--- a/src/rt/rust_upcall.cpp
+++ b/src/rt/rust_upcall.cpp
@@ -424,7 +424,10 @@ upcall_vec_grow(rust_task *task,
             task->fail(4);
             return NULL;
         }
-        v->deref();
+
+        if (v->ref_count != CONST_REFCOUNT)
+            v->deref();
+
         v = new (mem) rust_vec(dom, alloc, 0, NULL);
         *need_copy = 1;
     }