aboutsummaryrefslogtreecommitdiff
path: root/testes (unfollow)
Commit message (Collapse)AuthorFilesLines
2024-09-10Parameter for lua_gc/LUA_GCSTEP changed to 'size_t'Roberto Ierusalimschy3-3/+3
'size_t' is the common type for measuring memory. 'int' can be too small for steps.
2024-09-06Rename of fields in global state that control GCRoberto Ierusalimschy5-32/+32
All fields in the global state that control the pace of the garbage collector prefixed with 'GC'.
2024-09-06DetailsRoberto Ierusalimschy3-20/+20
Identation + comments
2024-08-22Added option for direct correction of stack pointersRoberto Ierusalimschy1-10/+44
The use of a pointer (not access, only for computations) after its deallocation is forbiden in ISO C, but seems to work fine in all platforms we are aware of. So, using that to correct stack pointers after a stack reallocation seems safe and is much simpler than the current implementation (first change all pointers to offsets and then changing the offsets back to pointers). Anyway, for now that option is disabled.
2024-08-20'lcode.c' can use 'checklimit', tooRoberto Ierusalimschy3-12/+10
2024-08-19A return can have at most 254 valuesRoberto Ierusalimschy2-0/+13
2024-08-17Bug: wrong code gen. for indices with comparisonsRoberto Ierusalimschy2-1/+10
In function 'luaK_exp2val', used to generate code for indices: Macro 'hasjumps' does not consider the case when the whole expression is a "jump" (a test). In all other of its uses, the surrounding code ensures that the expression cannot be VJMP.
2024-08-02Floats formatted with "correct" precisionRoberto Ierusalimschy3-21/+153
Conversion float->string ensures that, for any float f, tonumber(tostring(f)) == f, but still avoiding noise like 1.1 converting to "1.1000000000000001".
2024-07-30Struct 'transferinfo' moved to "lua_State"Roberto Ierusalimschy3-24/+16
That reduces the size of "CallInfo". Moreover, bit CIST_HOOKED from call status is not needed. When in a hook, 'transferinfo' is always valid, being zero when the hook is not call/return.
2024-07-27'-Wconversion' extended to all options of Lua numbersRoberto Ierusalimschy8-39/+50
2024-07-27Added gcc option '-Wconversion'Roberto Ierusalimschy44-359/+398
No warnings for standard numerical types. Still pending alternative numerical types.
2024-07-21'nresults' moved into 'callstatus'Roberto Ierusalimschy6-62/+79
That gives us more free bits in 'callstatus', for future use.
2024-07-19Using CIST_CLSRET instead of trick with 'nresults'Roberto Ierusalimschy4-30/+31
The callstatus flag CIST_CLSRET is used in all tests for the presence of variables to be closed in C functions.
2024-07-18Explicit limit for number of results in a callRoberto Ierusalimschy3-4/+17
The parameter 'nresults' in 'lua_call' and similar functions has a limit of 250. It already had an undocumented (and unchecked) limit of SHRT_MAX, but it is seldom larger than 2.
2024-07-16Maximum stack size may not fit in unsigned shortRoberto Ierusalimschy5-28/+46
Therefore, fields ftransfer/ntransfer in lua_Debug must have type 'int'. (Maximum stack size must fit in an 'int'.) Also, this commit adds check that maximum stack size respects size_t for size in bytes.
2024-07-05Removed compatibility with "= exp" in the REPLRoberto Ierusalimschy2-5/+2
2024-07-05Fixed bug in 'multiline'Roberto Ierusalimschy2-14/+19
'incomplete' was popping error message that should be used in case there is no more lines to complete the input, that is, 'pushline' returns NULL, due to end of file.
2024-07-05'printstack' (from ltests.c) made publicRoberto Ierusalimschy2-3/+7
That function is useful for debugging the API.
2024-07-04lua.c loads 'readline' dynamicallyRoberto Ierusalimschy4-29/+90
(See comments in luaconf.h.) This change allows easier compilation, as Lua compiles and works even if the package 'readline' is absent from the system. Moreover, non-interactive uses don't load the library, making the stand-alone slightly faster for small loads.
2024-07-02Small changes in casts from void* to functionsRoberto Ierusalimschy2-22/+26
Macro moved to llimits.h, and casts from void* to lua_CFunction first go through 'voidf' (a pointer to a function from void to void), a kind of void* for functions.
2024-07-01Updated dependencies in the make fileRoberto Ierusalimschy1-15/+23
Mainly to include 'llimits.h' in the non-kernel files
2024-06-28New instruction format for SETLIST/NEWTABLERoberto Ierusalimschy7-47/+97
New instruction format 'ivABC' (a variant of iABC where parameter vC has 10 bits) allows constructors of up to 1024 elements to be coded without EXTRAARG.
2024-06-27'isIT'/'isOT' turned from macros to functionsRoberto Ierusalimschy6-14/+38
2024-06-27Flexible limit for use of registers by constructorsRoberto Ierusalimschy5-7/+31
Instead of a fixed limit of 50 registers (which, in a bad worst case, can limit the nesting of constructors to 5 levels), the compiler computes an individual limit for each constructor based on how many registers are available when it runs. This limit then controls the frequency of SETLIST instructions.
2024-06-26Clearer code for controlling maximum registersRoberto Ierusalimschy3-10/+28
Plus, added a test to check that limit.
2024-06-24Length of external strings must fit in Lua integerRoberto Ierusalimschy4-4/+9
(As the length of any string in Lua.)
2024-06-21Details in the manualRoberto Ierusalimschy1-4/+9
2024-06-21Removed 'int' size limit for string.repRoberto Ierusalimschy2-16/+5
2024-06-21Removed 'int' size limit for pack/unpackRoberto Ierusalimschy2-38/+48
2024-06-21lua_writestring & co. moved to llimits.hRoberto Ierusalimschy4-32/+25
They don't need to be visible by clients of Lua.
2024-06-20llimits.h being used by all Lua codeRoberto Ierusalimschy14-73/+48
The definitions in llimits.h are useful not only for the core. That header only defines types and '#define's, so libs and core still do not share any real code/data.
2024-06-20Cleaning of llimits.hRoberto Ierusalimschy19-165/+159
Several definitions that don't need to be "global" (that is, that concerns only specific parts of the code) moved out of llimits.h, to more appropriate places.
2024-06-18GC test was not restarting collector after pauseRoberto Ierusalimschy1-1/+2
2024-06-12Tricky _PROMPT may trigger undefined behavior in lua.cRoberto Ierusalimschy1-2/+3
2024-06-12Bug: luaL_traceback may need more than 5 stack slotsRoberto Ierusalimschy3-1/+20
2024-06-12Bug: overlapping assignmentsRoberto Ierusalimschy1-2/+4
ISO C forbids assignment of a union field to another field of the same union.
2024-06-12More disciplined use of 'errno'Roberto Ierusalimschy3-10/+33
Set errno to zero before calling any function where we may use its errno, and check errno for zero before using it (as functions may not set it even in error). The code assumes that no function will put garbage on errno (although ISO C allows that): If any function during an operation set errno, and the operation result in an error, assume that errno has something to say.
2024-06-10Encoding of table indices (hres) must use C indicesRoberto Ierusalimschy4-24/+30
As the encoding of array indices is (~index), 0 is encoded as -1 and INT_MAX is encoded as INT_MIN.
2024-06-04Bug: Active-lines for stripped vararg functionsRoberto Ierusalimschy3-23/+34
Lua seg. faults when asked to create the 'activelines' table for a vararg function with no debug information.
2024-06-04Manual for 'string.format' lists what it acceptsRoberto Ierusalimschy1-3/+6
Instead of listing what it does not accept, which is always relative.
2024-05-27utf8.offset returns also final position of characterRoberto Ierusalimschy3-31/+55
'utf8.offset' returns two values: the initial and the final position of the given character.
2024-05-23Manual: errors in lua_toclose are not memory errorsRoberto Ierusalimschy3-3/+6
2024-05-08DetailsRoberto Ierusalimschy9-21/+36
Corrections in comments and manual. Added note in the manual about local variables in the REPL.
2024-05-02New year (2024)Roberto Ierusalimschy2-3/+3
2024-04-08'getmode' renamed to 'getMode'Roberto Ierusalimschy1-3/+3
The name 'getmode' conficts with a function from BSD, defined in <unistd.h>. Although 'lbaselib.c' cannot include that header, 'onelua.c' can.
2024-04-05Yet another representation for arraysRoberto Ierusalimschy3-44/+65
This "linear" representation (see ltable.h for details) has worse locality than cells, but the simpler access code seems to compensate that.
2024-04-03Small simplification in 'findloader'Roberto Ierusalimschy1-5/+4
Instead of allways adding a prefix for the next message, and then removing it if there is no message, add the prefix after each message.
2024-03-29Fixed dangling 'StkId' in 'luaV_finishget'Roberto Ierusalimschy5-26/+42
Bug introduced in 05932567.
2024-03-28DetailsRoberto Ierusalimschy2-7/+10
2024-03-22Some 'unsigned int' changed to 'unsigned'Roberto Ierusalimschy9-25/+24
'unsigned int' is too long sometimes. (We already write 'long' instead of 'long int'...)