about summary refs log tree commit diff
path: root/src/rt/rust_task.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/rt/rust_task.cpp')
-rw-r--r--src/rt/rust_task.cpp4
1 files changed, 4 insertions, 0 deletions
diff --git a/src/rt/rust_task.cpp b/src/rt/rust_task.cpp
index 084c8acd62b..43213b46773 100644
--- a/src/rt/rust_task.cpp
+++ b/src/rt/rust_task.cpp
@@ -423,6 +423,8 @@ rust_task::link_gc(gc_alloc *gcm) {
     gcm->prev = NULL;
     gcm->next = gc_alloc_chain;
     gc_alloc_chain = gcm;
+    if (gcm->next)
+        gcm->next->prev = gcm;
 }
 
 void
@@ -431,6 +433,8 @@ rust_task::unlink_gc(gc_alloc *gcm) {
         gcm->prev->next = gcm->next;
     if (gcm->next)
         gcm->next->prev = gcm->prev;
+    if (gc_alloc_chain == gcm)
+        gc_alloc_chain = gcm->next;
     gcm->prev = NULL;
     gcm->next = NULL;
 }