aboutsummaryrefslogtreecommitdiff
path: root/manual/2html (unfollow)
Commit message (Collapse)AuthorFilesLines
2025-07-18Randomness added to table length computationRoberto Ierusalimschy6-23/+48
A bad actor could fill only a few entries in a table (power of twos in decreasing order, see tests) and produce a small table with a huge length. If your program builds a table with external data and iterates over its length, this behavior could be an issue.
2025-07-18Correction in utf8.offsetRoberto Ierusalimschy2-3/+13
Wrong utf-8 character may have no continuation bytes.
2025-07-15Short strings can be external, tooRoberto Ierusalimschy9-120/+168
That complicates a little object equality (and therefore table access for long strings), but the old behavior was somewhat weird. (Short strings, a concept otherwise absent from the manual, could not be external.)
2025-07-09lua.c doesn't use function pointers with LUA_READLINERoberto Ierusalimschy1-22/+25
Bugs in macOS prevent assigning 'add_history' to 'l_addhist' without a warning.
2025-07-09New method to unload DLLsRoberto Ierusalimschy3-36/+98
External strings created by DLLs may need the DLL code to be deallocated. This implies that a DLL can only be unloaded after all its strings were deallocated, which happen only after the run of all finalizers. To ensure that order, we create a 'library string' to represent each DLL and keep it locked. When this string is deallocated (after the deallocation of any string created by the DLL) it closes its corresponding DLL.
2025-07-08lua option '--' may not be followed by scriptRoberto Ierusalimschy2-5/+7
2025-07-08Optional initialization for global declarationsRoberto Ierusalimschy7-38/+96
2025-07-07Correction in definition of CIST_FRESHRoberto Ierusalimschy1-2/+2
The cast must be made before the shift. If int has 16 bits, the shift would zero the value and the cast would cast 0 to 0.
2025-07-07Details (comments)Roberto Ierusalimschy5-8/+8
2025-07-01Added missing casts from lua_Unsigned to size_tRoberto Ierusalimschy2-3/+3
size_t can be smaller than lua_Usigned.
2025-07-01LUAI_MAXSTACK defined privatelyRoberto Ierusalimschy4-18/+17
LUAI_MAXSTACK is limited to INT_MAX/2, so can use INT_MAX/2 to define pseudo-indices (LUA_REGISTRYINDEX) in 'lua.h'. A change in the maximum stack size does not need to change the Lua-C ABI.
2025-06-27Warning in loslib.c (signed-unsigned comparison)Roberto Ierusalimschy1-2/+3
2025-06-27Manual updated to version 5.5Roberto Ierusalimschy2-9/+9
2025-06-26Cast added to 'add_history'Roberto Ierusalimschy1-2/+2
MacOS defines 'add_history' with a "wrong" type (it returns 'int' instead of 'void').
2025-06-23Application name for 'readline' is "lua", not "Lua"=listRoberto Ierusalimschy1-1/+1
2025-06-23Refactoring in the use of 'readline' by 'lua.c'Roberto Ierusalimschy1-33/+38
More common code for 'readline' loaded statically or dynamically (or not loaded).
2025-06-18No need to limit variable declarations to 250Roberto Ierusalimschy4-11/+38
Only local variables, which use registers, need this low limit.
2025-06-17Check string indices when loading binary chunkRoberto Ierusalimschy2-13/+11
Lua is not religious about that, but it tries to avoid crashes when loading binary chunks.
2025-06-16New metatable in an all-weak table can fool the GCRoberto Ierusalimschy2-2/+15
All-weak tables are not being revisited after being visited during propagation; if it gets a new metatable after that, the new metatable may not be marked.
2025-06-16Simpler code for 'traversetable'Roberto Ierusalimschy2-13/+31
Check the mode in a separate function (getmode), instead of using comma expressions inside the 'if' condition.
2025-06-13Dump uses varints also for integer constantsRoberto Ierusalimschy3-18/+48
Unlike sizes, these constants can be negative, so it encodes those integers into unsigned integers in a way that keeps small numbers small.
2025-06-13The main thread cannot be closedRoberto Ierusalimschy3-2/+10
No thread started with pcall (instead of resume) can be closed, because coroutine.close would not respect the expected number of results from the protected call.
2025-06-12A coroutine can close itselfRoberto Ierusalimschy6-21/+103
A call to close itself will close all its to-be-closed variables and return to the resume that (re)started the coroutine.
2025-06-04Loading a binary chunk should not break assertionsRoberto Ierusalimschy2-1/+4
Although the execution of a bad binary chunk can crash the interpreter, simply loading it should be safe.
2025-06-04Removed uneeded check in parserRoberto Ierusalimschy1-1/+0
In a constructor, each field generates at least one opcode, and the number of opcodes is limited by INT_MAX. Therefore, the counters for number of fields cannot exceed this limit. (The current limit for items in the hash part of a table has a limit smaller than INT_MAX. However, as long as there are no overflows, the logic for table resizing will handle that limit.)
2025-05-20Bug: check for constructor overflow in [exp] fieldsRoberto Ierusalimschy2-6/+5
The check for constructor overflow was considering only fields with explicit names, ignoring fields with syntax '[exp]=exp'.
2025-05-20New way to control preambular declarationRoberto Ierusalimschy4-15/+45
Validity of the preambular global declaration in controled together with all declarations, when checking variable names.
2025-05-18Proper error message when jumping into 'global *'Roberto Ierusalimschy3-9/+12
A goto cannot jump into the scope of any variable declaration, including 'global *'. To report the error, it needs a "name" for the scope it is entering.
2025-05-18Variable attributes can prefix name listRoberto Ierusalimschy15-60/+84
In this format, the attribute applies to all names in the list; e.g. "global<const> print, require, math".
2025-05-16DetailRoberto Ierusalimschy2-8/+7
Reports errors with "?:?:" (instead of "?:-1:") when there is no debug information.
2025-05-16Slightly faster way to check for "global"Roberto Ierusalimschy3-12/+13
2025-05-15Internalized string "break" kept by the parserRoberto Ierusalimschy3-3/+7
The parser uses "break" as fake label to compile "break" as "goto break". To avoid producing this string at each use, it keeps it available in its state.
2025-05-13Remove compat code in parser when not neededRoberto Ierusalimschy2-2/+5
2025-05-13Collective declaration for globals ('global *')Roberto Ierusalimschy14-63/+155
2025-05-12Correct line in error message for constant functionRoberto Ierusalimschy2-1/+8
2025-05-11'expdesc' doesn't depend on 'actvar' for var. info.Roberto Ierusalimschy3-17/+23
In preparation for 'global *', the structure 'expdesc' does not point to 'actvar.arr' for information about global variables.
2025-05-08Janitorial work on castsRoberto Ierusalimschy8-44/+47
2025-05-08Using 'l_uint32' for unicode codepoints in scannerRoberto Ierusalimschy4-7/+7
'l_uint32' is enough for unicode codepoints (versus unsigned long), and the utf-8 library already uses that type.
2025-05-08New syntax 'global function'Roberto Ierusalimschy4-13/+82
2025-05-06Checks for read-only globalsRoberto Ierusalimschy4-9/+33
2025-05-05First implementation of global declarationsRoberto Ierusalimschy10-117/+272
2025-04-23New macro 'pushvfstring'Roberto Ierusalimschy4-16/+13
Helps to ensure that 'luaO_pushvfstring' is being called correctly, with an error check after closing the vararg list with 'va_end'.
2025-04-23Details (typos in comments)Roberto Ierusalimschy16-30/+29
2025-04-17Function 'luaK_semerror' made varargRoberto Ierusalimschy3-20/+21
All calls to 'luaK_semerror' were using 'luaO_pushfstring' to create the error messages.
2025-04-15In gen. GC, some gray objects stay in gray listsRoberto Ierusalimschy2-2/+9
In generational collection, objects marked as touched1 stay in gray lists between collections. This commit fixes a bug introduced in commit 808976bb59.
2025-04-03Order change in 'pushfuncname'Roberto Ierusalimschy2-7/+7
'pushglobalfuncname' can be quite slow (as it traverses all globals and all loaded modules), so try first to get a name from the code.
2025-04-03Tiny refactoring in io.flushRoberto Ierusalimschy2-7/+25
2025-04-03io.write returns number of written bytes on errorRoberto Ierusalimschy4-7/+65
2025-04-01Corrections of stack addresses back to strict modeRoberto Ierusalimschy2-3/+3
It can be a little slower, but only for quite large stacks and moreover stack reallocation is not a common operation. With no strong contrary reason, it is better to follow the standard.
2025-03-31Growth factor of 1.5 for stack and lexical bufferRoberto Ierusalimschy3-11/+11