| Commit message (Collapse) | Author | Age | Files | Lines |
| |
|
|
|
| |
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.)
|
| |
|
|
|
| |
The structure 'AbsLineInfo' is hard-dumped into binary chunks, and
it comprises two 'int' fields.
|
| |
|
|
|
| |
Added macro LUA_FAILISFALSE to make easier to change the fail value
from nil to false.
|
| |
|
|
|
| |
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.
|
| |
|
|
|
| |
Array sizes are always int and are dumped as int, so there is no reason
to read them back as unsigned.
|
| |
|
|
|
| |
By default, the code assumes it is safe to use a dealocated pointer
as long as the code does not access it.
|