Closed jrobsonchase closed 4 months ago
Very nice catch!
The logic for Thread::tail_call_function
was incorrect in the case where meta_ops::call
triggered a type error. This only affected tail calls because the first thing that Thread::tail_call_function
did was pop the current Lua frame.
This should be fixed now, thank you for finding it!
From what I can tell, this occurs when directly returning the result of an attempted call to a nonexistent function. Using an intermediate variable produces a
Result::Err
as expected.Full example to reproduce:
Full backtrace: backtrace.txt