summaryrefslogtreecommitdiff
path: root/lfunc.c (unfollow)
Commit message (Collapse)AuthorFilesLines
2020-06-17Detail in 'lua_resetthread'Roberto Ierusalimschy1-5/+4
'lua_resetthread' should reset the CallInfo list before calling 'luaF_close'. luaF_close can call functions, and those functions should not run with dead functions still in the CallInfo list.
2020-06-16Fixed missing GC barriers in compiler and undumpRoberto Ierusalimschy2-14/+22
While building a new prototype, the GC needs barriers for every object (strings and nested prototypes) that is attached to the new prototype.
2020-06-15In 'lua_checkmemory', userdata can be gray, tooRoberto Ierusalimschy1-0/+4
Since commit ca6fe7449a74, userdata with uservalues can be gray and can belong to gray lists ('gclist').
2020-06-15'luaE_shrinkCI' shouldn't remove first free CallInfoRoberto Ierusalimschy1-8/+14
Due to emergency collections, 'luaE_shrinkCI' can be called while Lua is building a new CallInfo, which for a while is still a free CallInfo.
2020-06-10DetailsRoberto Ierusalimschy2-4/+3
2020-06-09Avoid calling 'fprintf' with NULLRoberto Ierusalimschy3-3/+7
Avoid undefined behavior in calls like «fprintf("%s", NULL)». ('lua_writestringerror' is implemented as 'fprintf', and 'lua_tostring' can return NULL if object is not a string.)
2020-06-01Fixed two bugs in to-be-closed variables x constantsRoberto Ierusalimschy3-30/+75
The parser were mixing compiler indices of variables with stack indices, so that when a to-be-closed variable was used inside the scope of compile-time constants (which may be optimized away), it might be closed in the wrong place. (See new tests for examples.) Besides fixing the bugs, this commit also changed comments and variable names to avoid that kind of confusion and added tests.
2020-05-29Improvements in the manualRoberto Ierusalimschy1-45/+86
- more consistent nomenclature for error handling - more precise definition for dead objects - added algorithm used by 'math.random' - added luaL_pushfail - some other minor changes
2020-05-27Details (more uniformity in error messages)Roberto Ierusalimschy3-15/+15
2020-05-22'luaL_execresult' does not assume -1 status as errorRoberto Ierusalimschy3-3/+6
ISO C is silent about the return of 'system'. Windows sets 'errno' in case of errors. Linux has several different error cases, with different return values. ISO C allows 'system' to set 'errno' even if there are no errors. Here we assume that a status==0 is success (which is the case on several platforms), otherwise it is an error. If there is an error number, gives the error based on it. (The worst a spurious 'errno' can do is to generate a bad error message.) Otherwise uses the normal results.
2020-05-22Improvements in the handling of signalsRoberto Ierusalimschy5-21/+25
Added 'volatile' to 'l_signalT' variables plus some minor changes.
2020-05-19Cleaner definition for 'TString'Roberto Ierusalimschy2-5/+8
Use a variable-sized array to store string contents at the end of a structure 'TString', instead of raw memory.
2020-05-07Details in commentsRoberto Ierusalimschy2-2/+2
2020-05-06Back to old encoding of versions in binary filesRoberto Ierusalimschy5-6/+11
(Undoing part of commit f53eabeed8.) It is better to keep this encoding stable, so that all Lua versions can read at least the version of a binary file.
2020-05-04C-Stack test does not assume minimum of 400 slotsRoberto Ierusalimschy1-17/+26
2020-04-30DetailsRoberto Ierusalimschy1-5/+9
When in test mode (#include "tests.h"), force Lua to use its own implementation of 'lua_strx2number' and 'lua_number2strx' to test them.
2020-04-29Fixed warning about casts between function pointersRoberto Ierusalimschy1-1/+8
gcc now warns (with -Wextra) about casts between pointers to different function types. The type 'void(*)(void)' works as a 'void*' for function pointers, cleaning the warning.
2020-04-23Several details about 5.4.0 rc1Roberto Ierusalimschy12-24/+22
Corrected several small details: added 'const', adjusts in tabs x spaces, removed unused #includes and #defines, misspellings, etc.
2020-04-23Small issue in 'exprstat'Roberto Ierusalimschy1-1/+2
The code should not compute an instruction address before checking that it exists. (Virtually no machine complains of computing an invalid address, as long as the address is not used, but for ISO C that is undefined behavior.)
2020-04-13Added 'simplesect' sections to the manualRoberto Ierusalimschy5-6/+56
'simplesect' encloses the introductory text of sections with subsections, so that each section either is all text or is all subsections. (This commit also corrects a small brace error in the manual and extra spaces/tabs in some other files.)
2020-04-10Improvements in the manualRoberto Ierusalimschy1-46/+64
Several small improvements, in particular a new subsection consolidating all status codes in the API.
2020-04-01Short strings always use all bytes in the hashRoberto Ierusalimschy3-7/+10
Collisions in short strings occurr just by their existence, when internalizing them. (Collisions in long strings is caused/controlled by the program, when adding them as keys to the same table.)
2020-03-16Fixed bug in 'string.format("%p")'Roberto Ierusalimschy3-8/+19
The string "(null)" used for non-collectable values must be printed as a string, not as a pointer. (Bug introduced in commit e0cbaa50fa7).
2020-03-02Fixed "conceptual" bug in 'luaK_setreturns'Roberto Ierusalimschy2-5/+5
This function was computing invalid instruction addresses when the expression was not a multi-return instruction. (Virtually all machines don't raise errors when computing an invalid address, as long as the address is not accessed, but this computation is undefined behavior in ISO C.)
2020-02-28Corrected direct use of 'snprintf' in 'lstrlib.c'Roberto Ierusalimschy1-1/+1
2020-02-27Code style in 'ldump'/'lundump'.Roberto Ierusalimschy2-149/+149
- function names start with lower case; - state is always the first parameter.
2020-02-27DetailsRoberto Ierusalimschy13-45/+52
Several details in code (e.g., moving a variable to the most inner scope that encloses its uses), comments, parameter names, extra tests.
2020-02-11OP_LOADFALSE broken in two instructionsRoberto Ierusalimschy6-6/+14
2020-01-31Tag values don't need to be different from type valuesRoberto Ierusalimschy1-18/+19
Variants can use zero for first variant.
2020-01-31Clearer distinction between types and tagsRoberto Ierusalimschy22-212/+230
LUA_T* represents only types; tags (types + Variants) are represented by LUA_V* constants.
2020-01-06New macro 'makevariant' to codify variant tagsRoberto Ierusalimschy1-11/+14
2020-01-06Changed internal representation of booleansRoberto Ierusalimschy14-52/+87
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.)
2019-12-30Fixed bug in 'aux_rawset'Roberto Ierusalimschy1-1/+1
In 'aux_rawset', top must be decremented after the barrier, which refers to top-1. (Bug introduced in commit c646e57fd.)
2019-12-30Comments (mosty typos)Roberto Ierusalimschy15-21/+28
2019-12-27Copyright year changed to 2020Roberto Ierusalimschy2-3/+3
2019-12-17Joined common code in 'lua_rawset' and 'lua_rawsetp'Roberto Ierusalimschy3-21/+23
2019-12-17Easy way to allow Unicode characters in identifiersRoberto Ierusalimschy1-16/+25
For those that want to try it...
2019-12-17Added test for NULL in string.format("%p")Roberto Ierusalimschy1-0/+2
ISO C states that standard library functions should not be called with NULL arguments, unless stated otherwise. 'sprintf' does not state otherwise, and it doesn't hurt to be on the safe side.
2019-12-13Small correction in assertionRoberto Ierusalimschy2-2/+2
2019-12-10Comment about LUA_COMPAT_LT_LE moved to proper placeRoberto Ierusalimschy2-6/+12
2019-12-05Simplifications in 'op_arith*' family of macrosRoberto Ierusalimschy1-47/+27
2019-12-05Using an enumeration for float->integer coercion modesRoberto Ierusalimschy4-22/+30
2019-12-05'l_mathlim' renamed to 'l_floatatt'Roberto Ierusalimschy4-8/+8
That macro is applied to float attributes, not to limits.
2019-12-05Better comments about the use of 'k' in opcodesRoberto Ierusalimschy2-30/+34
2019-12-05Manual a little more clear about string->number coersionsRoberto Ierusalimschy1-16/+25
2019-12-04Code reorganization for opcodes OP_FORPREP and OP_FORLOOPRoberto Ierusalimschy1-75/+116
Parts of the code for opcodes OP_FORPREP and OP_FORLOOP were moved to functions outside the interpreter loop.
2019-11-28Removed some wrong commentsRoberto Ierusalimschy1-8/+6
Both 'tonumber' and 'tointeger' cannot change the out parameter when the conversion fails.
2019-11-22More generic pattern when testing 'string.format'Roberto Ierusalimschy1-2/+2
The result of 'string.format("%a", 0.0)' can have multiple zeros after the dot.
2019-11-18DetailsRoberto Ierusalimschy6-15/+16
2019-11-08Using 'metavalues' for "metamethods" that are not methodsRoberto Ierusalimschy1-21/+26
Several "metamethods" are not required to be methods (functions), so it seems clearer not to call them metamethods. The manual now uses the word 'metavalue' for those values.