aboutsummaryrefslogtreecommitdiff
path: root/testes/errors.lua (unfollow)
Commit message (Collapse)AuthorFilesLines
2026-07-22DetailsRoberto I5-9/+18
- Some api_checknelems changed to the more restrict api_checkpop. - Added a class to the html for APIs in the manual. - Comments and manual.
2026-07-21Avoid casts to 'union GCUnion*'Roberto I1-20/+20
The union may have alignment requirements stricter than some of its members. Some checking tools (e.g., gcc with options -fsanitize) can then complain that the result of a cast from pointer to member to pointer to the union is misaligned.
2026-07-15MacOS by default uses statically linked readlineRoberto I2-6/+4
(plus detail in the manual)
2026-07-13Removed compiler option LUA_COMPAT_LOOPVARRoberto I3-23/+2
It makes loop variables read-only, but it does not restore the old semantics, so it is not helpful for compatibility.
2026-07-12Bug: Issues with write barrier for __newindexRoberto I2-6/+24
In 'luaV_finishset', there is an update on a table that is a field on another table. If the first table is the same as the one with the field (e.g., after 't.__newindex = t'), the update can change the value on that field (e.g., there may be a collision and the field is moved, or the field being updated is '__newindex' itself). After that, the barrier is called with the table stored in that field, which is not the correct table anymore.
2026-06-17Bug: 'luaL_newmetatable' used in a wrong wayRoberto I1-2/+15
The call to 'luaL_newmetatable' in 'newbox' can leave an incomplete metatable in the registry, if 'luaL_setfuncs' raises a memory error.
2026-06-03Removed unused function 'luaD_inctop'Roberto I2-7/+0
Commit 3228a97 removed all its uses.
2026-05-28Cleaning 'luaP_isIT' and 'luaP_isOT'Roberto I3-23/+17
- 'luaP_isOT' is only used for tests, so it is defined as a macro to avoid wasting space with an unused function. - 'luaP_isIT' must include OP_VARARGPREP.
2026-05-08Avoid warning in some compilersRoberto I1-0/+1
In function 'funcargs', some compilers can complain that 'args' can be used unitialized, due to the default case (syntax error).
2026-04-29Small correction in luaP_opmodesRoberto I1-1/+1
OP_VARARGPREP neither sets nor uses L->top.
2026-04-28DetailsRoberto Ierusalimschy3-7/+12
2026-04-23new macro 'setnilvalue2s'Roberto I9-23/+24
2026-04-23'load' reader function doesn't need to preserve stackRoberto I1-18/+9
2026-04-23Bug: 'lua_load' does not preserve the stackRoberto I7-27/+77
'lua_load' does not preserve the stack through the calls to the reader function, as it should. Immediately after the first call (to detect whether chunk is binary) it adds stuff, and it also adds a new table when starting the compilation of each new function.
2026-04-21DetailsRoberto I2-11/+21
Added compiler option LUA_NODEBUGLIB to make Lua with no open debug library + small improvements in the manual.
2026-04-13Better error messages for vararg-table fieldsRoberto I2-1/+4
2026-04-07Avoid macros luaL_loadbuffer and luaL_loadfileRoberto I6-15/+17
Use luaL_loadbufferx and luaL_loadfilex instead, being explicit about whether to accept binary chunks.
2026-04-01Stricter test for use of '__builtin_expect'Roberto I1-1/+1
GCC introduced this macro in version 3.
2026-04-01Bug: wrong initialization in result from 'gmatch'Roberto Ierusalimschy2-2/+18
Function returned by 'string.gmatch' can be left in an inconsistent state after an error.
2026-04-01Bug: Loading a binary chunk does not run the GCRoberto I1-0/+1
2026-03-15Adjustment in useless parameter L in macros luai_num*Roberto I2-9/+9
2026-03-09'table.tunpack' using 'aux_getn' like the othersRoberto I2-4/+20
'table.tunpack' was not checking its first argument, which could result in error messages generated inside the API, without location information.
2026-03-09DetailsRoberto I2-2/+2
2026-03-09Slightly better documentation for LUAI_MAXALIGNRoberto I2-4/+15
2026-02-18BUG: shift overflow in utf-8 decodeRoberto I3-3/+18
An initial byte \xFF will ask for 7 continuation bytes, and then the shift by (count * 5) will try to shift 35 bits.
2026-02-10DetailsRoberto Ierusalimschy2-10/+10
Spaces + added initialization to the documentation of global declarations.
2026-02-09Avoid an assignment of values that overlapRoberto Ierusalimschy1-4/+5
The original code was like this, where t->u.ind.t and t->u.info overlap: t->u.ind.t = cast_byte((t->k == VLOCAL) ? t->u.var.ridx: t->u.info);
2026-01-30Environment variable for readline library nameRoberto I2-7/+40
The name of the readline library can be changed from its default value through environment variable LUA_READLINELIB.
2026-01-29New year and (eventual) new releaseRoberto I2-4/+4
2026-01-23Explanation about char* parameters in the C APIRoberto I1-1/+13
2026-01-22Another way to handle option -ERoberto I1-6/+16
A pointer to function 'l_getenv' can point to the regular 'getenv' or to a dumb function (that always returns NULL) to ignore environment variables.
2026-01-20Some compilation options configurable from makefileRoberto Ierusalimschy5-5/+20
Compilation options LUA_COMPAT_GLOBAL, LUA_COMPAT_LOOPVAR, and LUA_READLINELIB do not affect the API, so they can be changed through the make file.
2026-01-16New compile option LUA_COMPAT_LOOPVARRoberto I2-2/+18
When on, this option makes for-loop control variables not read only.
2026-01-11More effort in avoiding errors in finalizersRoberto I8-16/+118
Before calling a finalizer, Lua not only checks stack limits, but actually ensures that a minimum number of slots are already allocated for the call. (If it cannot ensure that, it postpones the finalizer.) That avoids finalizers not running due to memory errors that the programmer cannot control.
2026-01-04Special case for 'string.rep' over an empty stringRoberto I2-5/+5
2026-01-04BUG: Possible overflow in 'string.packsize'Roberto I1-1/+1
'string.packsize' can overflow result in 32-bit machines using 64-bit integers, as LUA_MAXINTEGER may not fit into size_t.
2026-01-04DetailsRoberto I1-4/+5
In an assignment like 'a = &b', is looks suspicious if 'a' has a scope larger than 'b'.
2025-12-30DetailsRoberto I2-5/+4
Some comments still talked about bit 'isrealasize', which has been removed.
2025-12-27BUG: Arithmetic overflow in 'collectgarbage"step"'Roberto I1-2/+7
The computation of a new debt could overflow when we give a too large step to 'collectgarbage"step"' and the current debt was already negative. This is only an issue if your platform cares for it or if you compile Lua with an option like '-fsanitize=undefined'.
2025-12-23DetailsRoberto I3-3/+3
typo in comment + formatting + logical 'and' was written as a bitwise operation (makes code more fragile)
2025-12-13GC checks stack space before running finalizerv5.5.0Roberto I3-3/+16
If the stack does not have some minimum available space, the GC defers calling a finalizer until the next cycle. That avoids errors while running a finalizer that the programmer cannot control.
2025-12-13'luaL_newstate' starts state with warnings onRoberto I2-2/+3
It is easier to forget to turn them on then to turn them off.
2025-12-10Format adjust in the manualRoberto I1-19/+19
Lists in inline code don't get a space after commas. (That keeps the code more compact and avoids line breaks in the middle of the code.)
2025-12-08DetailsRoberto I2-8/+8
- Avoid fixing name "_ENV" in the code - Small improvements in the manual
2025-12-08Wrong assert in 'luaK_indexed'Roberto I1-3/+5
2025-12-01In luaB_close, running coroutines do not go to defaultrcRoberto I1-4/+6
This should had been corrected in commit fd897027f1.
2025-11-28Functions with vararg tables don't need hidden args.Roberto I9-43/+70
Vararg functions with vararg tables don't use the arguments hidden in the stack; therfore, it doesn't need to build/keep them.
2025-11-26New conceptual model for varargRoberto I11-69/+154
Conceptually, all functions get their vararg arguments in a vararg table. The storing of vararg arguments in the stack is always treated as an optimization.
2025-11-24DetailsRoberto I3-16/+23
Comments, capitalization in the manual, globals in test 'heady.lua'
2025-11-11'__pairs' can also return a to-be-closed objectRoberto I3-9/+15