aboutsummaryrefslogtreecommitdiff
Commit message (Collapse)AuthorAgeFilesLines
* Added gcc option '-Wconversion'Roberto Ierusalimschy2024-07-2744-359/+398
| | | | | No warnings for standard numerical types. Still pending alternative numerical types.
* 'nresults' moved into 'callstatus'Roberto Ierusalimschy2024-07-216-62/+79
| | | | That gives us more free bits in 'callstatus', for future use.
* Using CIST_CLSRET instead of trick with 'nresults'Roberto Ierusalimschy2024-07-194-30/+31
| | | | | The callstatus flag CIST_CLSRET is used in all tests for the presence of variables to be closed in C functions.
* Explicit limit for number of results in a callRoberto Ierusalimschy2024-07-183-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.
* Maximum stack size may not fit in unsigned shortRoberto Ierusalimschy2024-07-165-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.
* Removed compatibility with "= exp" in the REPLRoberto Ierusalimschy2024-07-052-5/+2
|
* Fixed bug in 'multiline'Roberto Ierusalimschy2024-07-052-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.
* 'printstack' (from ltests.c) made publicRoberto Ierusalimschy2024-07-052-3/+7
| | | | That function is useful for debugging the API.
* lua.c loads 'readline' dynamicallyRoberto Ierusalimschy2024-07-044-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.
* Small changes in casts from void* to functionsRoberto Ierusalimschy2024-07-022-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.
* Updated dependencies in the make fileRoberto Ierusalimschy2024-07-011-15/+23
| | | | Mainly to include 'llimits.h' in the non-kernel files
* New instruction format for SETLIST/NEWTABLERoberto Ierusalimschy2024-06-287-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.
* 'isIT'/'isOT' turned from macros to functionsRoberto Ierusalimschy2024-06-276-14/+38
|
* Flexible limit for use of registers by constructorsRoberto Ierusalimschy2024-06-275-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.
* Clearer code for controlling maximum registersRoberto Ierusalimschy2024-06-263-10/+28
| | | | Plus, added a test to check that limit.
* Length of external strings must fit in Lua integerRoberto Ierusalimschy2024-06-244-4/+9
| | | | (As the length of any string in Lua.)
* Details in the manualRoberto Ierusalimschy2024-06-211-4/+9
|
* Removed 'int' size limit for string.repRoberto Ierusalimschy2024-06-212-16/+5
|
* Removed 'int' size limit for pack/unpackRoberto Ierusalimschy2024-06-212-38/+48
|
* lua_writestring & co. moved to llimits.hRoberto Ierusalimschy2024-06-214-32/+25
| | | | They don't need to be visible by clients of Lua.
* llimits.h being used by all Lua codeRoberto Ierusalimschy2024-06-2014-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.
* Cleaning of llimits.hRoberto Ierusalimschy2024-06-2019-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.
* GC test was not restarting collector after pauseRoberto Ierusalimschy2024-06-181-1/+2
|
* Tricky _PROMPT may trigger undefined behavior in lua.cRoberto Ierusalimschy2024-06-121-2/+3
|
* Bug: luaL_traceback may need more than 5 stack slotsRoberto Ierusalimschy2024-06-123-1/+20
|
* Bug: overlapping assignmentsRoberto Ierusalimschy2024-06-121-2/+4
| | | | | ISO C forbids assignment of a union field to another field of the same union.
* More disciplined use of 'errno'Roberto Ierusalimschy2024-06-123-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.
* Encoding of table indices (hres) must use C indicesRoberto Ierusalimschy2024-06-104-24/+30
| | | | | As the encoding of array indices is (~index), 0 is encoded as -1 and INT_MAX is encoded as INT_MIN.
* Bug: Active-lines for stripped vararg functionsRoberto Ierusalimschy2024-06-043-23/+34
| | | | | Lua seg. faults when asked to create the 'activelines' table for a vararg function with no debug information.
* Manual for 'string.format' lists what it acceptsRoberto Ierusalimschy2024-06-041-3/+6
| | | | Instead of listing what it does not accept, which is always relative.
* utf8.offset returns also final position of characterRoberto Ierusalimschy2024-05-273-31/+55
| | | | | 'utf8.offset' returns two values: the initial and the final position of the given character.
* Manual: errors in lua_toclose are not memory errorsRoberto Ierusalimschy2024-05-233-3/+6
|
* DetailsRoberto Ierusalimschy2024-05-089-21/+36
| | | | | Corrections in comments and manual. Added note in the manual about local variables in the REPL.
* New year (2024)Roberto Ierusalimschy2024-05-022-3/+3
|
* 'getmode' renamed to 'getMode'Roberto Ierusalimschy2024-04-081-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.
* Yet another representation for arraysRoberto Ierusalimschy2024-04-053-44/+65
| | | | | | This "linear" representation (see ltable.h for details) has worse locality than cells, but the simpler access code seems to compensate that.
* Small simplification in 'findloader'Roberto Ierusalimschy2024-04-031-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.
* Fixed dangling 'StkId' in 'luaV_finishget'Roberto Ierusalimschy2024-03-295-26/+42
| | | | Bug introduced in 05932567.
* DetailsRoberto Ierusalimschy2024-03-282-7/+10
|
* Some 'unsigned int' changed to 'unsigned'Roberto Ierusalimschy2024-03-229-25/+24
| | | | | 'unsigned int' is too long sometimes. (We already write 'long' instead of 'long int'...)
* 'luaH_get' functions return tag of the resultRoberto Ierusalimschy2024-03-2110-132/+138
| | | | | | | Undoing previous commit. Returning TValue increases code size without any visible gains. Returning the tag is a little simpler than returning a special code (HOK/HNOTFOUND) and the tag is useful by itself in some cases.
* 'luaH_get' functions return 'TValue'Roberto Ierusalimschy2024-03-189-122/+124
| | | | | | Instead of receiving a parameter telling them where to put the result of the query, these functions return the TValue directly. (That is, they return a structure.)
* Removed "bulk operations"Roberto Ierusalimschy2024-03-153-57/+14
| | | | Negligible performance gains don't justify extra complexity.
* Added "bulk operations" to arraysRoberto Ierusalimschy2024-03-153-35/+99
| | | | | A few operations on arrays can be performed "in bulk", treating all tags of a cell as a simple (or a few) word(s).
* DetailsRoberto Ierusalimschy2024-03-134-6/+5
| | | | | | - 'unsigned int' -> 'unsigned' - Some explicit casts to avoid warnings - Test avoids printing the value of 'fail' (which may not be nil)
* Removed type 'varint_t'Roberto Ierusalimschy2024-03-133-32/+23
| | | | | | size_t should be big enough to count the number of strings in a dump. (And, by definition, it is big enough to count the length of each string.)
* API asserts for illegal pops of to-be-closed variablesRoberto Ierusalimschy2024-03-115-30/+45
|
* Fixed warnings from different compilersRoberto Ierusalimschy2024-02-154-6/+10
|
* New interface to function 'luaL_openselectedlibs'Roberto Ierusalimschy2024-02-158-56/+80
| | | | | Instead of preloading all non-loaded libraries, there is another mask to select which libraries to preload.
* Revising code for Varint encoding in dumpsRoberto Ierusalimschy2024-02-123-29/+45
| | | | | | | | - Usign lua_Unsigned to count strings. - Varint uses a type large enough both for size_t and lua_Unsigned. - Most-Significant Bit 0 means last byte, to conform to common usage. - (unrelated) Change in macro 'getaddr' so that multiplication is by constants.