Closed osch closed 6 years ago
I enhanced the patch for the case, that a custom logger is used via llthreads.set_logger()
, because lua_concat()
also does not like nil
parameters, this results to:
PANIC: unprotected error in call to Lua API (attempt to concatenate a nil value)
Passing NULL to
fputs()
crashes under Linux (I did not try this on other platforms).This occurs for Lua 5.1 when a non string error is triggerd (e.g. table object): the traceback function for Lua 5.1 in
traceback.inc
pushesnil
onto the stack, whereas for other Lua versions the__tostring
metamethod is tried and otherwise the string"(no error message)"
is pushed.I simply put an
if (msg)
around thefputs()
invocation, however other solutions might be better, e.g. trying also to evaluate the__tostring
meta method as it is done for newer lua versions.