Skip to content

Commit cf05593

Browse files
committed
Fix Debug::is_tail_call
1 parent d011a1f commit cf05593

File tree

1 file changed

+6
-3
lines changed

1 file changed

+6
-3
lines changed

src/debug.rs

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -153,15 +153,18 @@ impl<'a> Debug<'a> {
153153

154154
/// Corresponds to the `t` "what" mask. Returns true if the hook is in a function tail call,
155155
/// false otherwise.
156-
#[cfg(not(feature = "luau"))]
157-
#[cfg_attr(docsrs, doc(cfg(not(feature = "luau"))))]
156+
#[cfg(any(feature = "lua54", feature = "lua53", feature = "lua52"))]
157+
#[cfg_attr(
158+
docsrs,
159+
doc(cfg(any(feature = "lua54", feature = "lua53", feature = "lua52")))
160+
)]
158161
pub fn is_tail_call(&self) -> bool {
159162
unsafe {
160163
mlua_assert!(
161164
ffi::lua_getinfo(self.state, cstr!("t"), self.ar) != 0,
162165
"lua_getinfo failed with `t`"
163166
);
164-
(*self.ar).currentline != 0
167+
(*self.ar).istailcall != 0
165168
}
166169
}
167170

0 commit comments

Comments
 (0)