| Commit message (Collapse) | Author | Age | Files | Lines |
|
|
|
|
| |
Lua will change a nil as error object to a string message, so that it
never reports an error with nil as the error object.
|
|
|
|
|
| |
Instead of receiving nil as a second argument, __close metamethods are
called with just one argument when there are no errors.
|
|
|
|
|
|
| |
Lua can easily overflow an unsigned short counting nested calls.
(The limit to this value is the maximum stack size, LUAI_MAXSTACK,
which is currently 1e6.)
|
|
|
|
|
| |
Comments, small changes in the manual, an extra test for errors in
error handling, small changes in tests.
|
|
|
|
|
|
|
|
|
| |
Since commit f407b3c4a, it was being used for two distinct (and
incompatible) meanings:
A: Function has TBC variables (now bit CIST_TBC)
B: Interpreter is closing TBC variables (original bit CIST_CLSRET)
B implies A, but A does not imply B.
|
|
|
|
| |
Tables don't accept sizes larger than int.
|
|
|
|
|
| |
'luaD_throw' may call 'luaE_resetthread', which returns an error code
but clears 'L->status'; so, 'luaD_throw' should set that status again.
|
|
|
|
| |
New year (2024->2025), typos in comments
|
|
|
|
|
| |
Plus some other details. (Option '-Wuninitialized' was removed from
the makefile because it is already enabled by -Wall.)
|
|
|
|
|
|
|
|
|
|
|
|
| |
The compilation of a goto or a label just create an entry and generate
boilerplate code for the gotos. As we don't know yet whether it needs a
CLOSE, we code a jump followed by a CLOSE, which is then dead code.
When a block ends (and then we know for sure whether there are variables
that need to be closed), we check the goto's against the labels of that
block. When closing a goto against a label, if it needs a CLOSE, the
compiler swaps the order of the jump and the CLOSE, making the CLOSE
active.
|
|
|
|
|
|
| |
Optimize this opcode for the common case. For long names or method
calls after too many constants, operation can be coded as a move
followed by 'gettable'.
|
|
|
|
|
|
|
|
|
|
| |
Instead of using 'alimit' for keeping the size of the array and at
the same time being a hint for '#t', a table now keeps these two
values separate. The Table structure has a field 'asize' with the
size of the array, while the length hint is kept in the array itself.
That way, tables with no array part waste no space with that field.
Moreover, the space for the hint may have zero cost for small arrays,
if the array of tags plus the hint still fits in a single word.
|
|
|
|
| |
The call to 'f' is done by the macro, to give it more flexibility.
|
|
|
|
|
|
| |
'debug.getinfo' can return number of extra arguments added to a call by
a chain of __call metavalues. That information is being used to improve
error messages about errors in these extra arguments.
|
|
|
|
|
| |
This counter will allow (in a later commit) error messages to correct
argument numbers in functions called through __call metamethods.
|
|
|
|
|
|
|
|
| |
Without this extra space, sequences of insertions/deletions (and
some other uses) can have unpexpected low performances. See the
added tests for an example, and *Mathematical Models to Analyze Lua
Hybrid Tables and Why They Need a Fix* (MartÃnez, Nicaud, Rotondo;
arXiv:2208.13602v2) for detais.
|
|
|
|
|
|
|
|
| |
Array part needs 1/3 of its elements filled, instead of 1/2.
Array entries use ~1/3 the memory of hash entries, so this new rule
still ensures that array parts do not use more memory than keeping
the values in the hash, while allowing more uses of the array part,
which is more efficient than the hash.
|
|
|
|
|
|
|
| |
If there are no integer keys outside the array part, there is no
reason to resize it, saving the time to count its elements. Moreover,
assignments to non-integer keys will not collapse a table created with
'table.create'.
|
| |
|
| |
|
| |
|
|
|
|
|
|
|
| |
In function 'luaK_exp2val', used to generate code for indices: Macro
'hasjumps' does not consider the case when the whole expression is a
"jump" (a test). In all other of its uses, the surrounding code ensures
that the expression cannot be VJMP.
|
|
|
|
|
|
| |
Conversion float->string ensures that, for any float f,
tonumber(tostring(f)) == f, but still avoiding noise like 1.1
converting to "1.1000000000000001".
|
| |
|
|
|
|
|
| |
The callstatus flag CIST_CLSRET is used in all tests for the
presence of variables to be closed in C functions.
|
| |
|
|
|
|
|
|
| |
'incomplete' was popping error message that should be used in case
there is no more lines to complete the input, that is, 'pushline'
returns NULL, due to end of file.
|
|
|
|
|
|
|
| |
(See comments in luaconf.h.) This change allows easier compilation,
as Lua compiles and works even if the package 'readline' is absent
from the system. Moreover, non-interactive uses don't load the library,
making the stand-alone slightly faster for small loads.
|
|
|
|
|
|
|
|
| |
Instead of a fixed limit of 50 registers (which, in a bad worst case,
can limit the nesting of constructors to 5 levels), the compiler
computes an individual limit for each constructor based on how many
registers are available when it runs. This limit then controls the
frequency of SETLIST instructions.
|
|
|
|
| |
Plus, added a test to check that limit.
|
| |
|
| |
|
| |
|
| |
|
|
|
|
|
| |
Lua seg. faults when asked to create the 'activelines' table for a
vararg function with no debug information.
|
|
|
|
|
| |
'utf8.offset' returns two values: the initial and the final position
of the given character.
|
|
|
|
|
| |
Corrections in comments and manual. Added note in the manual about
local variables in the REPL.
|
|
|
|
| |
Bug introduced in 05932567.
|
|
|
|
|
|
| |
- 'unsigned int' -> 'unsigned'
- Some explicit casts to avoid warnings
- Test avoids printing the value of 'fail' (which may not be nil)
|
| |
|
|
|
|
|
| |
Instead of preloading all non-loaded libraries, there is another
mask to select which libraries to preload.
|
|
|
|
|
|
|
|
| |
Avoid silent conversions from int to unsigned int when calling
'luaH_resize'; avoid silent conversions from lua_Integer to int in
'table.create'; MAXASIZE corrected for the new implementation of arrays;
'luaH_resize' checks explicitly whether new size respects MAXASIZE.
(Even constructors were bypassing that check.)
|
| |
|
|\ |
|
| |
| |
| |
| |
| |
| |
| |
| | |
Yielding in a hook must decrease the program counter, because it already
counted an instruction that, in the end, was not executed. However,
that decrement should be done only when about to restart the thread.
Otherwise, inspecting the thread with the debug library shows it one
instruction behind of where it really is.
|
| |
| |
| |
| |
| | |
Creates a table preallocating memory. (It just exports to Lua the API
function 'lua_createtable'.)
|
| | |
|
| |
| |
| |
| |
| | |
The reference system has a defined way to add initial values to the
table where it operates.
|
| | |
|
| |
| |
| |
| |
| |
| | |
- back with step size in collectgarbage("step")
- adjustments in defaults for some GC parameters
- adjustments in 'luaO_codeparam'
|