@@ -156,7 +156,6 @@ impl Thread {
156
156
let thread_state = self . state ( ) ;
157
157
unsafe {
158
158
let _sg = StackGuard :: new ( state) ;
159
- let _thread_sg = StackGuard :: with_top ( thread_state, 0 ) ;
160
159
161
160
let nargs = args. push_into_stack_multi ( & lua) ?;
162
161
if nargs > 0 {
@@ -165,6 +164,7 @@ impl Thread {
165
164
pushed_nargs += nargs;
166
165
}
167
166
167
+ let _thread_sg = StackGuard :: with_top ( thread_state, 0 ) ;
168
168
let ( _, nresults) = self . resume_inner ( & lua, pushed_nargs) ?;
169
169
check_stack ( state, nresults + 1 ) ?;
170
170
ffi:: lua_xmove ( thread_state, state, nresults) ;
@@ -192,12 +192,12 @@ impl Thread {
192
192
let thread_state = self . state ( ) ;
193
193
unsafe {
194
194
let _sg = StackGuard :: new ( state) ;
195
- let _thread_sg = StackGuard :: with_top ( thread_state, 0 ) ;
196
195
197
196
check_stack ( state, 1 ) ?;
198
197
error. push_into_stack ( & lua) ?;
199
198
ffi:: lua_xmove ( state, thread_state, 1 ) ;
200
199
200
+ let _thread_sg = StackGuard :: with_top ( thread_state, 0 ) ;
201
201
let ( _, nresults) = self . resume_inner ( & lua, ffi:: LUA_RESUMEERROR ) ?;
202
202
check_stack ( state, nresults + 1 ) ?;
203
203
ffi:: lua_xmove ( thread_state, state, nresults) ;
0 commit comments