🚀 coroutine.resume can pass arguments

This commit is contained in:
ValKmjolnir
2023-01-02 18:53:58 +08:00
parent 4672211575
commit 22aa3ac5b7
7 changed files with 36 additions and 9 deletions
+1 -1
View File
@@ -587,7 +587,7 @@ Then we call `resume`, this function will change stack.
As we can see, coroutine stack already has some values on it,
but if we first enter it, the stack top will be `vm_ret`, and the return `pc` is `0`.
So for safe running, `resume` will return `gc.top[0]`.
So for safe running, when first calling the coroutine, `resume` will return `gc.top[0]`.
`op_callb` will do `top[0]=resume()`, so the value does not change.
```C++