| Commit message (Collapse) | Author | Age | Files | Lines |
|
|
|
| |
Added as incompatibility, in the manual, the extra return of 'io.lines'.
|
|
|
|
|
|
| |
'lua_resetthread' should reset the CallInfo list before calling
'luaF_close'. luaF_close can call functions, and those functions
should not run with dead functions still in the CallInfo list.
|
|
|
|
|
| |
While building a new prototype, the GC needs barriers for every object
(strings and nested prototypes) that is attached to the new prototype.
|
|
|
|
|
| |
Since commit ca6fe7449a74, userdata with uservalues can be gray
and can belong to gray lists ('gclist').
|
|
|
|
|
| |
Due to emergency collections, 'luaE_shrinkCI' can be called while Lua
is building a new CallInfo, which for a while is still a free CallInfo.
|
| |
|
|
|
|
|
|
| |
Avoid undefined behavior in calls like «fprintf("%s", NULL)».
('lua_writestringerror' is implemented as 'fprintf', and 'lua_tostring'
can return NULL if object is not a string.)
|
|
|
|
|
|
|
|
|
|
| |
The parser were mixing compiler indices of variables with stack indices,
so that when a to-be-closed variable was used inside the scope of
compile-time constants (which may be optimized away), it might be closed
in the wrong place. (See new tests for examples.)
Besides fixing the bugs, this commit also changed comments and variable
names to avoid that kind of confusion and added tests.
|
|
|
|
|
|
|
|
| |
- more consistent nomenclature for error handling
- more precise definition for dead objects
- added algorithm used by 'math.random'
- added luaL_pushfail
- some other minor changes
|
| |
|
|
|
|
|
|
|
|
|
|
|
| |
ISO C is silent about the return of 'system'. Windows sets 'errno' in
case of errors. Linux has several different error cases, with different
return values. ISO C allows 'system' to set 'errno' even if there are no
errors. Here we assume that a status==0 is success (which is the case
on several platforms), otherwise it is an error. If there is an error
number, gives the error based on it. (The worst a spurious 'errno'
can do is to generate a bad error message.) Otherwise uses the normal
results.
|
|
|
|
| |
Added 'volatile' to 'l_signalT' variables plus some minor changes.
|
|
|
|
|
| |
Use a variable-sized array to store string contents at the end of a
structure 'TString', instead of raw memory.
|
| |
|
|
|
|
|
|
| |
(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.
|
| |
|