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.cpp8
1 files changed, 6 insertions, 2 deletions
diff --git a/src/rt/rust_task.cpp b/src/rt/rust_task.cpp
index d631a68f898..97e22618741 100644
--- a/src/rt/rust_task.cpp
+++ b/src/rt/rust_task.cpp
@@ -576,16 +576,20 @@ rust_task::new_stack(size_t stk_sz, void *args_addr, size_t args_sz) {
     new_sp = align_down(new_sp - (args_sz + sizeof_retaddr));
     new_sp += sizeof_retaddr;
     memcpy(new_sp, args_addr, args_sz);
-    record_sp(stk_seg->data + RED_ZONE_SIZE);
+    record_stack_limit();
     return new_sp;
 }
 
 void
 rust_task::del_stack() {
     del_stk(this, stk);
-    record_sp(stk->data + RED_ZONE_SIZE);
+    record_stack_limit();
 }
 
+void
+rust_task::record_stack_limit() {
+    record_sp(stk->data + RED_ZONE_SIZE);
+}
 //
 // Local Variables:
 // mode: C++