aboutsummaryrefslogtreecommitdiff
path: root/loslib.c (unfollow)
Commit message (Collapse)AuthorFilesLines
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
2025-03-27Small optimization in 'project' from math.randomRoberto Ierusalimschy1-21/+9
When computing the Mersenne number, instead of spreading 1's a fixed number of times (with shifts of 1, 2, 4, 8, 16, and 32), spread only until the number becomes a Mersenne number.
2025-03-27New macro 'l_numbits'Roberto Ierusalimschy6-15/+9
2025-03-25Addition in math.random can overflowRoberto Ierusalimschy1-2/+2
To avoid complains from some tools, the addition when computing math.random(n,m), which is computed as n + random(0, m - n), should use unsigned integers.
2025-03-24DetailsRoberto Ierusalimschy2-25/+28
Small changes in test library: - execute mode added to 'all.lua'; - more information about subtypes (tags) when printing a stack.
2025-03-17Detail in the manualRoberto Ierusalimschy1-6/+8
2025-03-17New function 'resetCI'Roberto Ierusalimschy2-19/+39
New function 'resetCI' resets the CallInfo list of a thread, ensuring a proper state when creating a new thread, closing a thread, or closing a state, so that we can run code after that. (When closing a thread, we need to run its __close metamethods; when closing a state, we need to run its __close metamethods and its finalizers.)
2025-03-17New function 'printallstack' in test libraryRoberto Ierusalimschy2-0/+24
2025-03-14Wrong error message when using "_ENV" fieldsRoberto Ierusalimschy3-6/+16
The string "_ENV" is erroneously identified as a variable _ENV, so that results from a field is classified as a global.
2025-03-14Missing GC barrier in 'luaV_finishset'Roberto Ierusalimschy3-3/+19
2025-03-13Use after free in 'luaV_finishset'Roberto Ierusalimschy3-1/+25
If a metatable is a weak table, its __newindex field could be collected by an emergency collection while being used in 'luaV_finishset'. (This bug has similarities with bug 5.3.2-1, fixed in commit a272fa66.)
2025-03-12'luaD_seterrorobj' should not raise errorsRoberto Ierusalimschy5-22/+25
This function can be called unprotected, so it should not raise any kind of errors. (It could raise a memory-allocation error when creating a message).
2025-03-12Small changes in the manualRoberto Ierusalimschy1-16/+22
2025-03-12Removed copyright notice from 'testes/all.lua'Roberto Ierusalimschy32-60/+33
All test files refer to the main copyright notice in 'lua.h'.