lua-users home
lua-l archive

Dead code in lauxlib.c?

[Date Prev][Date Next][Thread Prev][Thread Next] [Date Index] [Thread Index]


While going through the code in lauxlib.c (in RC7 which seems to be
identical to the final beta release candidate) to see how error handlers
in lua_pcall work, I noticed a couple of things about the code that
generates stack traces that I thought I'd point out.
* findfield includes a variable named found that's initialized to 0 and
 used in the while loop condition, but never set to any other value
 (the function returns directly when it finds what it's looking for).
* pushfuncname checks the activation record's 'what' field to see if
 it's 'C' or 't', and if so it thinks it has a function and tries to
 find the name for it. The documentation doesn't mention anything
 about what 't' might mean. 
I searched but couldn't find anything that would set the 'what' field
to anything other than the documented values. Assuming that's the case
the code could be cleaned up a little bit.
I thought I'd mention it for the sake of clarity, since the final
version isn't released yet.

AltStyle によって変換されたページ (->オリジナル) /