| Commit message (Collapse) | Author | Age | Files | Lines |
|
|
|
|
| |
For consistency in the C API, avoid any initializations before
callling lua_lock.
|
|
|
|
|
|
|
| |
Allow memory errors to be raised through the API (throwing the
error with the memory error message); error in external allocations
raises a memory error; memory errors in coroutines are re-raised
as memory errors.
|
|
|
|
|
| |
Several of its callers needed that case and had to do the check
themselves.
|
|
|
|
|
|
|
|
|
| |
In 'lundump.c', when loading the upvalues of a function, there can be
a read error if the chunk is truncated. In that case, the creation
of the error message can trigger an emergency collection while the
prototype is still anchored. So, the prototype must be GC consistent
before loading the upvales, which implies that it the 'name' fields
must be filled with NULL before the reading.
|
|
|
|
|
| |
LUA_T* represents only types; tags (types + Variants) are represented
by LUA_V* constants.
|
|
|
|
|
|
|
| |
Instead of an explicit value (field 'b'), true and false use different
tag variants. This avoids reading an extra field and results in more
direct code. (Most code that uses booleans needs to distinguish between
true and false anyway.)
|
|
|
|
|
| |
In 'aux_rawset', top must be decremented after the barrier, which
refers to top-1. (Bug introduced in commit c646e57fd.)
|
| |
|
| |
|
|
|
|
|
| |
Both 'tonumber' and 'tointeger' cannot change the out parameter when
the conversion fails.
|
|
|
|
|
|
| |
With MMBIN instructions, there are fewer opcodes that need to update
'L->top', so that change does not seem to pay for the increased
complexity.
|
|
|
|
|
|
|
| |
Instead of updating 'L->top' in every place that may call a
metamethod, the metamethod functions themselves (luaT_trybinTM and
luaT_callorderTM) correct the top. (When calling metamethods from
the C API, however, the callers must preserve 'L->top'.)
|
|
|
|
|
| |
In 'lua_settop', avoid calling 'luaF_close' when increasing the stack
or when the function has no to-be-closed variables.
|
|
|
|
|
|
| |
When leaving a scope, the new stack top should be set only after
closing any upvalue, to avoid manipulating values in an "invalid"
part of the stack.
|
|
|
|
|
|
|
|
| |
Checks of the form '1 <= x && x <= M' were rewritten in the form
'(unsigned)x - 1 < (unsigned)M', which is usually more efficient.
(Other similar checks have similar translations.) Although
some compilers do these optimizations, that does not happen
for all compilers or all cases.
|
|
|
|
|
|
|
|
| |
- The warning functions get an extra parameter that tells whether
message is to be continued (instead of using end-of-lines as a signal).
- The user data for the warning function is a regular value, instead
of a writable slot inside the Lua state.
|
|
|
|
|
|
|
|
|
|
| |
Several small improvements (code style, warnings, comments, more tests),
in particular:
- 'lua_topointer' extended to handle strings
- raises an error in 'string.format("%10q")' ('%q' with modifiers)
- in the manual for 'string.format', the term "option" replaced by
"conversion specifier" (the term used by the C standard)
|
|
|
|
|
|
|
| |
After a major bad collection (one that collects too few objects),
next collection will be major again. In that case, avoid switching
back to generational mode (as it will have to switch again to
incremental to do next major collection).
|
|
|
|
|
| |
Errors in finalizers (__gc metamethods) are never propagated.
Instead, they generate a warning.
|
|
|
|
|
| |
The warning system is just a way for Lua to emit warnings, messages
to the programmer that do not interfere with the running program.
|
|
|
|
|
|
|
|
|
|
| |
* unification of the 'nny' and 'nCcalls' counters;
* external C functions ('lua_CFunction') count more "slots" in
the C stack (to allow for their possible use of buffers)
* added a new test script specific for C-stack overflows. (Most
of those tests were already present, but concentrating them
in a single script easies the task of checking whether
'LUAI_MAXCCALLS' is adequate in a system.)
|
|
|
|
|
|
|
| |
It is an error for a to-be-closed variable to have a non-closable
non-nil value when it is being closed. This situation does not seem to
be useful and often hints to an error. (Particularly in the C API, it is
easy to change a to-be-closed index by mistake.)
|
|
|
|
|
|
|
| |
To remove a to-be-closed variable from the stack in the C API a
function must use 'lua_settop' or 'lua_pop'. Previous implementation of
'luaL_pushresult' was not closing the box. (This commit also added
tests to check that box is being closed "as soon as possible".)
|
|
|
|
|
|
| |
Sometimes it is useful to mark to-be-closed an index that is not
at the top of the stack (e.g., if the value to be closed came from
a function call returning multiple values).
|
|
|
|
|
|
|
| |
The new syntax is <local *toclose x = f()>. The mark '*' allows other
attributes to be added later without the need of new keywords; it
also allows better error messages. The API function was also renamed
('lua_tobeclosed' -> 'lua_toclose').
|
| |
|
| |
|
|
|
|
|
| |
Version numbers and dates (mostly wrong) from RCS keyword strings
removed from all source files; only the file name are kept.
|
|
|
|
| |
Lua should work correctly with several copies of the kernel
|
|
|
|
| |
addresses of static variables
|
|
|
|
| |
macro 'api_checkvalidindex' (used only once) expanded and removed
|
|
|
|
| |
(now uses static variables)
|
| |
|
| |
|
| |
|
|
|
|
|
| |
rttype -> rawtt; ttyperaw -> withvariant; ttype -> ttypetag;
tnov -> ttype
|
|
|
|
| |
(still no metamethods, no raw verssions)
|
|
|
|
| |
(so that, in the future, tables can contain regular nil entries)
|
| |
|
| |
|
| |
|
| |
|
| |
|
| |
|
|
|
|
|
| |
automatically raise an error), which allows fixing a bug when resizing
a table.
|
| |
|
| |
|
| |
|
| |
|
| |
|