aboutsummaryrefslogtreecommitdiff
path: root/testes (follow)
Commit message (Collapse)AuthorAgeFilesLines
* Functions with vararg tables don't need hidden args.Roberto I2025-11-281-0/+3
| | | | | Vararg functions with vararg tables don't use the arguments hidden in the stack; therfore, it doesn't need to build/keep them.
* New conceptual model for varargRoberto I2025-11-263-5/+41
| | | | | | 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.
* DetailsRoberto I2025-11-241-8/+10
| | | | Comments, capitalization in the manual, globals in test 'heady.lua'
* '__pairs' can also return a to-be-closed objectRoberto I2025-11-111-1/+6
|
* External strings are as good as internal onesRoberto I2025-11-111-0/+17
| | | | A '__mode' metafield and an "n" key both can be external strings.
* Correction in line info for semantic errorsRoberto I2025-11-111-22/+42
| | | | Semantic errors should refer the last used token, not the next one.
* Global initialization checks name conflictRoberto I2025-11-082-3/+22
| | | | | Initialization "global a = 10" raises an error if global 'a' is already defined, that is, it has a non-nil value.
* Vertical bar removed from syntax of vararg tableRoberto I2025-10-303-15/+15
| | | | | | The syntax 'function foo (a, b, ...arg)' is already used by JavaScript for this same semantics, so it seems natural to use the same notation in Lua.
* Case VVARGIND added to luaK_storevarRoberto Ierusalimschy2025-10-301-0/+12
| | | | | | In a global initialization, the variable does not pass through 'check_readonly', and therefore a VVARGIND is not normalized to a VINDEXED.
* Fixed initialization of global variablesRoberto I2025-10-291-0/+22
| | | | | | | | When calling 'luaK_storevar', the 'expdesc' for the variable must be created before the one for the expression, to satisfy the assumptions for register allocation. So, in a statement like 'global a = exp', where 'a' is actually '_ENV.a', this variable must be handled before the initializing expression 'exp'.
* Two new memory testsRoberto I2025-10-121-9/+33
| | | | For external strings and for vararg tables.
* Initialization of too many locals break assertionRoberto I2025-10-101-7/+12
| | | | | | The check for limit of local variables is made after generating code to initialize them. If there are too many local variables not initialized, the coding of instruction OP_LOADNIL could overflow an argument.
* Optimization for vararg tablesRoberto I2025-09-242-10/+43
| | | | | | | A vararg table can be virtual. If the vararg table is used only as a base in indexing expressions, the code does not need to create an actual table for it. Instead, it compiles the indexing expressions into direct accesses to the internal vararg data.
* Varag parameter is a new kind of variableRoberto I2025-09-171-0/+26
| | | | To allow some optimizations on its use.
* Vararg tableRoberto I2025-09-161-4/+7
| | | | Not yet optimized nor documented.
* DetailsRoberto I2025-09-052-2/+2
| | | | | | | - LUAMOD_API defined as 'extern "C"' in C++. - "ANSI C" is in fact "ISO C" (comments) - Removed option -std from makefile in testes/libs. (Easier to change to C++ for tests).
* Removed code for compatibility with version 5.3Roberto I2025-08-201-1/+2
|
* Functions 'frexp'-'ldexp' back to the math libraryRoberto I2025-08-091-0/+12
| | | | | They are basic for anything that handles the representation of floating numbers.
* DetailsRoberto I2025-08-091-0/+14
|
* Randomness added to table length computationRoberto Ierusalimschy2025-07-181-0/+12
| | | | | | | 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.
* Correction in utf8.offsetRoberto Ierusalimschy2025-07-181-0/+9
| | | | Wrong utf-8 character may have no continuation bytes.
* Short strings can be external, tooRoberto Ierusalimschy2025-07-151-7/+21
| | | | | | | 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.)
* New method to unload DLLsRoberto Ierusalimschy2025-07-092-1/+58
| | | | | | | | | | 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.
* lua option '--' may not be followed by scriptRoberto Ierusalimschy2025-07-081-4/+5
|
* Optional initialization for global declarationsRoberto Ierusalimschy2025-07-085-7/+28
|
* No need to limit variable declarations to 250Roberto Ierusalimschy2025-06-182-6/+34
| | | | Only local variables, which use registers, need this low limit.
* New metatable in an all-weak table can fool the GCRoberto Ierusalimschy2025-06-161-0/+10
| | | | | | 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.
* Simpler code for 'traversetable'Roberto Ierusalimschy2025-06-161-0/+5
| | | | | Check the mode in a separate function (getmode), instead of using comma expressions inside the 'if' condition.
* Dump uses varints also for integer constantsRoberto Ierusalimschy2025-06-131-0/+18
| | | | | | Unlike sizes, these constants can be negative, so it encodes those integers into unsigned integers in a way that keeps small numbers small.
* The main thread cannot be closedRoberto Ierusalimschy2025-06-131-0/+5
| | | | | | 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.
* A coroutine can close itselfRoberto Ierusalimschy2025-06-121-9/+53
| | | | | A call to close itself will close all its to-be-closed variables and return to the resume that (re)started the coroutine.
* New way to control preambular declarationRoberto Ierusalimschy2025-05-202-2/+22
| | | | | Validity of the preambular global declaration in controled together with all declarations, when checking variable names.
* Proper error message when jumping into 'global *'Roberto Ierusalimschy2025-05-181-5/+8
| | | | | | 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.
* Variable attributes can prefix name listRoberto Ierusalimschy2025-05-1813-25/+36
| | | | | In this format, the attribute applies to all names in the list; e.g. "global<const> print, require, math".
* DetailRoberto Ierusalimschy2025-05-161-2/+2
| | | | | Reports errors with "?:?:" (instead of "?:-1:") when there is no debug information.
* Collective declaration for globals ('global *')Roberto Ierusalimschy2025-05-1312-26/+61
|
* Correct line in error message for constant functionRoberto Ierusalimschy2025-05-121-0/+7
|
* New syntax 'global function'Roberto Ierusalimschy2025-05-082-1/+30
|
* Checks for read-only globalsRoberto Ierusalimschy2025-05-061-0/+10
|
* First implementation of global declarationsRoberto Ierusalimschy2025-05-053-4/+57
|
* Details (typos in comments)Roberto Ierusalimschy2025-04-2312-26/+26
|
* Order change in 'pushfuncname'Roberto Ierusalimschy2025-04-031-2/+2
| | | | | 'pushglobalfuncname' can be quite slow (as it traverses all globals and all loaded modules), so try first to get a name from the code.
* Tiny refactoring in io.flushRoberto Ierusalimschy2025-04-031-1/+18
|
* io.write returns number of written bytes on errorRoberto Ierusalimschy2025-04-031-0/+31
|
* DetailsRoberto Ierusalimschy2025-03-241-0/+0
| | | | | | Small changes in test library: - execute mode added to 'all.lua'; - more information about subtypes (tags) when printing a stack.
* New function 'resetCI'Roberto Ierusalimschy2025-03-171-0/+19
| | | | | | | | 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.)
* Wrong error message when using "_ENV" fieldsRoberto Ierusalimschy2025-03-141-0/+3
| | | | | The string "_ENV" is erroneously identified as a variable _ENV, so that results from a field is classified as a global.
* Missing GC barrier in 'luaV_finishset'Roberto Ierusalimschy2025-03-141-0/+15
|
* Use after free in 'luaV_finishset'Roberto Ierusalimschy2025-03-131-1/+12
| | | | | | 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.)
* 'luaD_seterrorobj' should not raise errorsRoberto Ierusalimschy2025-03-121-2/+2
| | | | | | 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).