Shared tail: write `val` over the parked coro's saved-stack top and mark it Ready. */
(&mut self, idx: usize, val: Val)
| 99 | |
| 100 | /* Shared tail: write `val` over the parked coro's saved-stack top and mark it Ready. */ |
| 101 | fn deliver_host_result(&mut self, idx: usize, val: Val) { |
| 102 | let coro = self.scheduler[idx].coro; |
| 103 | if let HeapObj::Coroutine(_, _, saved_stack, _, _, sub_frames, _) = self.heap.get_mut(coro) { |
| 104 | let target_stack = if let Some(frame) = sub_frames.last_mut() { &mut frame.stack_delta } else { saved_stack }; |
| 105 | if let Some(top) = target_stack.last_mut() { *top = val; } else { target_stack.push(val); } |
| 106 | } |
| 107 | self.scheduler[idx].state = CoroState::Ready; |
| 108 | } |
| 109 | |
| 110 | /* String form of `inject_host_result`: allocates `message` on the heap and injects it. Used by Rust hosts that return text bodies (and test fixtures simulating that path). */ |
| 111 | pub fn push_host_result(&mut self, message: &str) -> Result<bool, VmErr> { |
no test coverage detected