Skip to content

Commit 1bd1359

Browse files
committed
Exclude the first arg when checking for yield_with call.
This is part of the previous commit
1 parent feec72b commit 1bd1359

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/state/raw.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1325,7 +1325,7 @@ impl RawLua {
13251325
let mut ctx = Context::from_waker(rawlua.waker());
13261326
match fut.as_mut().map(|fut| fut.as_mut().poll(&mut ctx)) {
13271327
Some(Poll::Pending) => {
1328-
let fut_nvals = ffi::lua_gettop(state);
1328+
let fut_nvals = ffi::lua_gettop(state) - 1; // Exclude the future itself
13291329
if fut_nvals >= 3 && ffi::lua_tolightuserdata(state, -3) == Lua::poll_yield().0 {
13301330
// We have some values to yield
13311331
ffi::lua_pushnil(state);

0 commit comments

Comments
 (0)