diff options
Diffstat (limited to '')
-rw-r--r-- | src/cancel.cpp | 13 |
1 files changed, 7 insertions, 6 deletions
diff --git a/src/cancel.cpp b/src/cancel.cpp index 2f3c22e..3a01ac2 100644 --- a/src/cancel.cpp +++ b/src/cancel.cpp | |||
@@ -213,7 +213,7 @@ CancelOp which_cancel_op(char const* op_string_) | |||
213 | lua_remove(L, idx_); // argument is processed, remove it | 213 | lua_remove(L, idx_); // argument is processed, remove it |
214 | if (op == CancelOp::Invalid) | 214 | if (op == CancelOp::Invalid) |
215 | { | 215 | { |
216 | std::ignore = luaL_error(L, "invalid hook option %s", str); | 216 | std::ignore = luaL_error(L, "invalid hook option %s", str); // doesn't return |
217 | } | 217 | } |
218 | return op; | 218 | return op; |
219 | } | 219 | } |
@@ -260,6 +260,7 @@ LUAG_FUNC(thread_cancel) | |||
260 | wake_lane = lua_toboolean(L, 2); | 260 | wake_lane = lua_toboolean(L, 2); |
261 | lua_remove(L, 2); // argument is processed, remove it | 261 | lua_remove(L, 2); // argument is processed, remove it |
262 | } | 262 | } |
263 | STACK_CHECK_START_REL(L, 0); | ||
263 | switch (thread_cancel(lane, op, hook_count, wait_timeout, wake_lane)) | 264 | switch (thread_cancel(lane, op, hook_count, wait_timeout, wake_lane)) |
264 | { | 265 | { |
265 | default: // should never happen unless we added a case and forgot to handle it | 266 | default: // should never happen unless we added a case and forgot to handle it |
@@ -267,15 +268,15 @@ LUAG_FUNC(thread_cancel) | |||
267 | break; | 268 | break; |
268 | 269 | ||
269 | case CancelResult::Timeout: | 270 | case CancelResult::Timeout: |
270 | lua_pushboolean(L, 0); | 271 | lua_pushboolean(L, 0); // false |
271 | lua_pushstring(L, "timeout"); | 272 | lua_pushstring(L, "timeout"); // false "timeout" |
272 | break; | 273 | break; |
273 | 274 | ||
274 | case CancelResult::Cancelled: | 275 | case CancelResult::Cancelled: |
275 | lua_pushboolean(L, 1); | 276 | lua_pushboolean(L, 1); // true |
276 | std::ignore = push_thread_status(L, lane); | 277 | push_thread_status(L, lane); // true status |
277 | break; | 278 | break; |
278 | } | 279 | } |
279 | // should never happen, only here to prevent the compiler from complaining of "not all control paths returning a value" | 280 | STACK_CHECK(L, 2); |
280 | return 2; | 281 | return 2; |
281 | } | 282 | } |