| Commit message (Collapse) | Author | Age | Files | Lines |
|
|
|
|
|
|
| |
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.
|
|
|
|
| |
Wrong utf-8 character may have no continuation bytes.
|
|
|
|
|
|
|
| |
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.)
|
|
|
|
|
|
|
|
|
|
| |
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.
|
| |
|
| |
|
|
|
|
| |
Only local variables, which use registers, need this low limit.
|
|
|
|
|
|
| |
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.
|
|
|
|
|
| |
Check the mode in a separate function (getmode), instead of using
comma expressions inside the 'if' condition.
|
|
|
|
|
|
| |
Unlike sizes, these constants can be negative, so it encodes those
integers into unsigned integers in a way that keeps small numbers
small.
|
|
|
|
|
|
| |
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 call to close itself will close all its to-be-closed variables and
return to the resume that (re)started the coroutine.
|
|
|
|
|
| |
Validity of the preambular global declaration in controled together
with all declarations, when checking variable names.
|
|
|
|
|
|
| |
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.
|
|
|
|
|
| |
In this format, the attribute applies to all names in the list;
e.g. "global<const> print, require, math".
|
|
|
|
|
| |
Reports errors with "?:?:" (instead of "?:-1:") when there is no debug
information.
|
| |
|
| |
|
| |
|
| |
|
| |
|
| |
|
|
|
|
|
| |
'pushglobalfuncname' can be quite slow (as it traverses all globals and
all loaded modules), so try first to get a name from the code.
|
| |
|
| |
|
|
|
|
|
|
| |
Small changes in test library:
- execute mode added to 'all.lua';
- more information about subtypes (tags) when printing a stack.
|
|
|
|
|
|
|
|
| |
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.)
|
|
|
|
|
| |
The string "_ENV" is erroneously identified as a variable _ENV,
so that results from a field is classified as a global.
|
| |
|
|
|
|
|
|
| |
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.)
|
|
|
|
|
|
| |
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).
|
|
|
|
| |
All test files refer to the main copyright notice in 'lua.h'.
|
|
|
|
|
|
| |
Tests for memory-allocation errors moved from 'api.lua' to this new
file, as 'api.lua' was already too big. (Besides, these tests have
nothing to do with the API.)
|
|
|
|
|
| |
The structure 'AbsLineInfo' is hard-dumped into binary chunks, and
it comprises two 'int' fields.
|
|
|
|
|
| |
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.
|