Fixed bug when polling async futures (#77)

We expect first value returned via coroutine.yield() to be a special Pending type.
But instead we checked second value.
This commit is contained in:
Alex Orlenko 2021-10-02 07:23:24 +01:00
parent 584b377640
commit c62b17a5c8
No known key found for this signature in database
GPG Key ID: 4C150C250863B96D
1 changed files with 1 additions and 1 deletions

View File

@ -344,7 +344,7 @@ where
#[inline(always)]
fn is_poll_pending(val: &MultiValue) -> bool {
match val.iter().enumerate().last() {
Some((1, Value::LightUserData(ud))) => {
Some((0, Value::LightUserData(ud))) => {
ud.0 == &ASYNC_POLL_PENDING as *const u8 as *mut c_void
}
_ => false,