| Commit message (Collapse) | Author | Age | Files | Lines |
| |
|
|
|
|
|
|
| |
(Undoing part of commit f53eabeed8.) It is better to keep this encoding
stable, so that all Lua versions can read at least the version of a
binary file.
|
| |
|
|
|
|
|
| |
When in test mode (#include "tests.h"), force Lua to use its own
implementation of 'lua_strx2number' and 'lua_number2strx' to test them.
|
|
|
|
|
|
| |
gcc now warns (with -Wextra) about casts between pointers to different
function types. The type 'void(*)(void)' works as a 'void*' for function
pointers, cleaning the warning.
|
|
|
|
|
| |
Corrected several small details: added 'const', adjusts in tabs x
spaces, removed unused #includes and #defines, misspellings, etc.
|
|
|
|
|
|
|
| |
The code should not compute an instruction address before checking that
it exists. (Virtually no machine complains of computing an invalid
address, as long as the address is not used, but for ISO C that is
undefined behavior.)
|
|
|
|
|
|
|
| |
'simplesect' encloses the introductory text of sections with
subsections, so that each section either is all text or is all
subsections. (This commit also corrects a small brace error in the
manual and extra spaces/tabs in some other files.)
|
|
|
|
|
| |
Several small improvements, in particular a new subsection consolidating
all status codes in the API.
|
|
|
|
|
|
| |
Collisions in short strings occurr just by their existence, when
internalizing them. (Collisions in long strings is caused/controlled
by the program, when adding them as keys to the same table.)
|
|
|
|
|
| |
The string "(null)" used for non-collectable values must be printed as a
string, not as a pointer. (Bug introduced in commit e0cbaa50fa7).
|
|
|
|
|
|
|
|
| |
This function was computing invalid instruction addresses when the
expression was not a multi-return instruction. (Virtually all machines
don't raise errors when computing an invalid address, as long as the
address is not accessed, but this computation is undefined behavior in
ISO C.)
|
| |
|
|
|
|
|
| |
- function names start with lower case;
- state is always the first parameter.
|
|
|
|
|
| |
Several details in code (e.g., moving a variable to the most inner
scope that encloses its uses), comments, parameter names, extra tests.
|
| |
|
|
|
|
| |
Variants can use zero for first variant.
|
|
|
|
|
| |
LUA_T* represents only types; tags (types + Variants) are represented
by LUA_V* constants.
|
| |
|
|
|
|
|
|
|
| |
Instead of an explicit value (field 'b'), true and false use different
tag variants. This avoids reading an extra field and results in more
direct code. (Most code that uses booleans needs to distinguish between
true and false anyway.)
|
|
|
|
|
| |
In 'aux_rawset', top must be decremented after the barrier, which
refers to top-1. (Bug introduced in commit c646e57fd.)
|
| |
|
| |
|
| |
|
|
|
|
| |
For those that want to try it...
|
|
|
|
|
|
| |
ISO C states that standard library functions should not be called
with NULL arguments, unless stated otherwise. 'sprintf' does not
state otherwise, and it doesn't hurt to be on the safe side.
|
| |
|
| |
|
| |
|
| |
|
|
|
|
| |
That macro is applied to float attributes, not to limits.
|
| |
|
| |
|
|
|
|
|
| |
Parts of the code for opcodes OP_FORPREP and OP_FORLOOP were moved
to functions outside the interpreter loop.
|
|
|
|
|
| |
Both 'tonumber' and 'tointeger' cannot change the out parameter when
the conversion fails.
|
|
|
|
|
| |
The result of 'string.format("%a", 0.0)' can have multiple zeros
after the dot.
|
| |
|
|
|
|
|
|
| |
Several "metamethods" are not required to be methods (functions),
so it seems clearer not to call them metamethods. The manual now
uses the word 'metavalue' for those values.
|
|
|
|
|
| |
Both 'R' and 'K' are arrays, so the comments should use square
brackets to index them.
|
|
|
|
|
|
|
| |
The file 'bugs' reports bugs in several different versions
(corresponding to different branches in the repository), without
a clear division of "this bugs belongs to this version". So, it
doesn't make sense to track it along with one (or many) versions.
|
|
|
|
|
| |
A tail call of a __call chain (a __call metamethod that itself is
also not a function) was being perfomed as a regular call.
|
| |
|
|
|
|
|
|
| |
The initial "\n\t" to properly indent a searcher message is being added
by 'findloader' when building the error message, instead of being
included in the original message by each searcher itself.
|
| |
|
| |
|
|
|
|
|
|
|
| |
In 'str__dump', the call to 'lua_dump' assumes the function is on the
top of the stack, but the manual allows 'luaL_buffinit' to push stuff
on the stack (although the current implementation does not). So, the
call to 'luaL_buffinit' must come after the call to 'lua_dump'.
|
|
|
|
|
|
| |
The old definition did one test for nil, but three tests for the all
too common booleans (and two tests for other values); this definition
does two tests for all values.
|
| |
|
|
|
|
|
|
| |
New threads were being created with very small C-stack limits.
This is not a problem for coroutines, because 'lua_resume' sets
a new limit, but not all threads are coroutines.
|
| |
|