| Commit message (Collapse) | Author | Files | Lines |
|
More common code for 'readline' loaded statically or dynamically (or
not loaded).
|
|
Only local variables, which use registers, need this low limit.
|
|
Lua is not religious about that, but it tries to avoid crashes when
loading binary chunks.
|
|
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.
|
|
Although the execution of a bad binary chunk can crash the interpreter,
simply loading it should be safe.
|
|
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.)
|
|
The check for constructor overflow was considering only fields with
explicit names, ignoring fields with syntax '[exp]=exp'.
|
|
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.
|
|
|
|
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.
|
|
|
|
|
|
|
|
In preparation for 'global *', the structure 'expdesc' does not point
to 'actvar.arr' for information about global variables.
|
|
|
|
'l_uint32' is enough for unicode codepoints (versus unsigned long),
and the utf-8 library already uses that type.
|
|
|
|
|
|
|
|
Helps to ensure that 'luaO_pushvfstring' is being called correctly,
with an error check after closing the vararg list with 'va_end'.
|
|
|
|
All calls to 'luaK_semerror' were using 'luaO_pushfstring' to create
the error messages.
|
|
In generational collection, objects marked as touched1 stay in gray
lists between collections. This commit fixes a bug introduced in
commit 808976bb59.
|
|
'pushglobalfuncname' can be quite slow (as it traverses all globals and
all loaded modules), so try first to get a name from the code.
|
|
|
|
|
|
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.
|
|
|
|
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.
|
|
|
|
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.
|
|
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.)
|
|
After a weak table is traversed in the atomic phase, if it does not
have white values ('hasclears') it does not need to be retraversed
again. (Comments were correct, but code did not agree with them.)
|