@@ -41,7 +41,6 @@ call_upcall_on_c_stack(void *args, void *fn_ptr) {
4141 do_sanity_check (task);
4242 rust_scheduler *sched = task->sched ;
4343 sched->c_context .call_shim_on_c_stack (args, fn_ptr);
44- do_sanity_check (task);
4544}
4645
4746extern " C" void record_sp (void *limit);
@@ -72,7 +71,6 @@ upcall_call_shim_on_c_stack(void *args, void *fn_ptr) {
7271
7372 task = rust_scheduler::get_task ();
7473 task->record_stack_limit ();
75- do_sanity_check (task);
7674}
7775
7876/* *********************************************************************/
@@ -411,6 +409,10 @@ upcall_vec_push(rust_vec** vp, type_desc* elt_ty, void* elt) {
411409 // because this upcall calls take glue
412410 s_vec_push_args args = {vp, elt_ty, elt};
413411 upcall_s_vec_push (&args);
412+
413+ // Do the stack check to make sure this op, on the Rust stack, is behaving
414+ rust_task *task = rust_scheduler::get_task ();
415+ task->check_stack_canary ();
414416}
415417
416418/* *********************************************************************
@@ -645,7 +647,7 @@ upcall_reset_stack_limit() {
645647 rust_task *task = rust_scheduler::get_task ();
646648 do_sanity_check (task);
647649 task->reset_stack_limit ();
648- do_sanity_check ( task);
650+ task-> check_stack_canary ( );
649651}
650652
651653//
0 commit comments