aboutsummaryrefslogtreecommitdiff
path: root/testes (follow)
Commit message (Collapse)AuthorAgeFilesLines
...
* 'recover' finish of 'luaD_pcall' should follow the originalRoberto Ierusalimschy2020-10-121-4/+22
|
* Avoid shrinking stacks to oftenRoberto Ierusalimschy2020-10-121-1/+49
| | | | | | Shrink a stack only when the final stack size can be at most 2/3 the previous size with half of its entries empty. This commit also improves the clarity of 'luaD_growstack'.
* Avoid GCs when testing stack overflowRoberto Ierusalimschy2020-10-121-6/+14
| | | | | A GC step may invoke some finalizer, which may error and emit a warning due to stack overflfow.
* Revision of stackless implementationRoberto Ierusalimschy2020-10-122-108/+32
| | | | | | - more organized handling of 'nCcalls' - comments - deprecation of 'setcstacklimit'
* Back to a stackless implementationRoberto Ierusalimschy2020-10-123-6/+7
| | | | | | | | | | | | | A "with stack" implementation gains too little in performance to be worth all the noise from C-stack overflows. This commit is almost a sketch, to test performance. There are several pending stuff: - review control of C-stack overflow and error messages; - what to do with setcstacklimit; - review comments; - review unroll of Lua calls.
* Fixed bug of long strings in binary chunksRoberto Ierusalimschy2020-08-181-1/+15
| | | | | | | When "undumping" a long string, the function 'loadVector' can call the reader function, which can run the garbage collector, which can collect the string being read. So, the string must be anchored during the call to 'loadVector'.
* TOUCHED2 objects are not always blackRoberto Ierusalimschy2020-08-131-0/+17
| | | | | | | This commit fixes a bug introduced in commit 9cf3299fa. TOUCHED2 objects are always black while the mutator runs, but they can become temporarily gray inside a minor collection (e.g., if the object is a weak table).
* Better tests for gray listsRoberto Ierusalimschy2020-08-071-0/+2
| | | | | Test uses an extra bit in 'marked' to mark all elements in gray lists and then check against elements colored gray.
* Free bit 7 of GC 'marked' fieldRoberto Ierusalimschy2020-08-071-0/+11
| | | | | | | | Tables were using this bit to indicate their array sizes were real ('isrealasize'), but this bit can be useful for tests. Instead, they can use bit 7 of their 'flag' field for that purpose. (There are only six fast-access metamethods.) This 'flag' field only exists in tables, so this use does not affect other types.
* Optimization in 'markold'Roberto Ierusalimschy2020-07-291-0/+16
| | | | | | | | | | OLD1 objects can be potentially anywhere in the 'allgc' list (up to 'reallyold'), but frequently they are all after 'old1' (natural evolution of survivals) or do not exist at all (when all objects die young). So, instead of 'markold' starts looking for them always from the start of 'allgc', the collector keeps an extra pointer, 'firstold1', that points to the first OLD1 object in the 'allgc' list, or is NULL if there are no OLD1 objects in that list.
* Fixed bug: line hooks in stripped functionsRoberto Ierusalimschy2020-07-271-1/+18
| | | | | Line-hook handling was accessing debug info. without checking whether it was present.
* Fixed bug: barriers cannot be active during sweepRoberto Ierusalimschy2020-07-271-1/+27
| | | | | | | Barriers cannot be active during sweep, even in generational mode. (Although gen. mode is not incremental, it can hit a barrier when deleting a thread and closing its upvalues.) The colors of objects are being changed during sweep and, therefore, cannot be trusted.
* Fixed bug: invalid mode can crash 'io.popen'Roberto Ierusalimschy2020-07-151-0/+15
|
* Fixed bug: wrong stack limit when entering a coroutineRoberto Ierusalimschy2020-07-131-0/+16
| | | | | | When entering a coroutine, the computation of nCcalls added 'from->nci' to correct for preallocated CallInfos, but 'nci' includes also the Callinfos already used.
* Added test for fix 127e7a6c894Roberto Ierusalimschy2020-07-131-0/+30
|
* Make sure that main thread is non yieldableRoberto Ierusalimschy2020-07-061-2/+12
| | | | | Main thread must be non yieldable even at "level 0" (bare API), outside the 'pcall' from 'lua.c'.
* Keep memory errors as memory errorsRoberto Ierusalimschy2020-07-061-16/+59
| | | | | | | 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.
* Avoid memory allocation in some functions from 'ltests.c'Roberto Ierusalimschy2020-07-044-10/+10
| | | | | | | To allow their use in memory tests, some functions in 'ltests.c' should never allocate memory. To avoid this allocation, the library registers the strings used for status codes, and keeps the variable '_WARN' always defined (with false instead of nil).
* Simplification and smaller buffers for 'lua_pushfstring'Roberto Ierusalimschy2020-07-031-1/+1
| | | | | The function 'lua_pushfstring' is seldom called with large strings, there is no need to optimize too much for that cases.
* Fixed detail in 'loadUpvalues'Roberto Ierusalimschy2020-06-301-6/+15
| | | | | | | | | 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.
* Fixed two bugs in to-be-closed variables x constantsRoberto Ierusalimschy2020-06-011-0/+37
| | | | | | | | | | 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.
* Details (more uniformity in error messages)Roberto Ierusalimschy2020-05-271-9/+9
|
* Back to old encoding of versions in binary filesRoberto Ierusalimschy2020-05-061-2/+2
| | | | | | (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.
* C-Stack test does not assume minimum of 400 slotsRoberto Ierusalimschy2020-05-041-17/+26
|
* Fixed bug in 'string.format("%p")'Roberto Ierusalimschy2020-03-161-4/+14
| | | | | The string "(null)" used for non-collectable values must be printed as a string, not as a pointer. (Bug introduced in commit e0cbaa50fa7).
* DetailsRoberto Ierusalimschy2020-02-274-1/+11
| | | | | Several details in code (e.g., moving a variable to the most inner scope that encloses its uses), comments, parameter names, extra tests.
* Changed internal representation of booleansRoberto Ierusalimschy2020-01-061-5/+5
| | | | | | | 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.)
* Comments (mosty typos)Roberto Ierusalimschy2019-12-309-14/+21
|
* Joined common code in 'lua_rawset' and 'lua_rawsetp'Roberto Ierusalimschy2019-12-172-4/+9
|
* More generic pattern when testing 'string.format'Roberto Ierusalimschy2019-11-221-2/+2
| | | | | The result of 'string.format("%a", 0.0)' can have multiple zeros after the dot.
* Fixed bug in tail calls of __call chainsRoberto Ierusalimschy2019-10-281-1/+24
| | | | | A tail call of a __call chain (a __call metamethod that itself is also not a function) was being perfomed as a regular call.
* Change in the prefix of messages from searchersRoberto Ierusalimschy2019-10-241-0/+23
| | | | | | The initial "\n\t" to properly indent a searcher message is being added by 'findloader' when building the error message, instead of being included in the original message by each searcher itself.
* Script 'packtests' gets Lua version as a parameterRoberto Ierusalimschy2019-10-021-1/+3
|
* Janitorial workRoberto Ierusalimschy2019-10-011-2/+5
| | | | | | | - Several details in 'lcode.c' - A few more tests for code generation - Bug in assert in 'lcode.c' ("=" x "==") - Comments in 'lopcodes.h' and 'ltable.c'
* Subtraction of small constant integers optimized with OP_ADDIRoberto Ierusalimschy2019-09-243-4/+5
|
* 'setCstacklimit' renamed to 'setcstacklimit'Roberto Ierusalimschy2019-09-241-12/+12
| | | | Function names in the API use only lowercase letters.
* Removed arithmetic opcodes with immediate operandRoberto Ierusalimschy2019-09-101-9/+9
| | | | | | | The difference in performance between immediate operands and K operands does not seem to justify all those extra opcodes. We only keep OP_ADDI, due to its ubiquity and because the difference is a little more relevant. (Later, OP_SUBI will be implemented by OP_ADDI, negating the constant.)
* Use of 'MMBIN' opcodes extended to shift operatorsRoberto Ierusalimschy2019-08-282-6/+5
| | | | Plus, this commit removes useless 'tm' parameters in 'op_*' macros.
* First version of OP_MMBIN opcodesRoberto Ierusalimschy2019-08-272-29/+36
| | | | | | | | | | | In arithmetic/bitwise operators, the call to metamethods is made in a separate opcode following the main one. (The main opcode skips this next one when the operation succeeds.) This change reduces slightly the size of the binary and the complexity of the arithmetic/bitwise opcodes. It also simplfies the treatment of errors and yeld/resume in these operations, as there are much fewer cases to consider. (Only OP_MMBIN/OP_MMBINI/OP_MMBINK, instead of all variants of all arithmetic/bitwise operators.)
* Fixed missing case in 'luaV_finishOp'Roberto Ierusalimschy2019-08-271-0/+6
| | | | | A metamethod call like '1 << a' was not being properly resumed if it got yielded.
* Fixed bug when yiedling inside OP_ADDK opcodeRoberto Ierusalimschy2019-08-211-0/+11
| | | | | | The family of opcodes OP_ADDK (arithmetic operators with K constant) were not being handled in 'luaV_finishOp', which completes their task after an yield.
* Default for warnings changed to "off"Roberto Ierusalimschy2019-08-205-7/+13
| | | | | Warnings are mostly a tool to help developers (e.g., by showing hidden error messages); regular users usually don't need to see them.
* Detail (extra test for warnings when closing state)Roberto Ierusalimschy2019-08-191-0/+11
|
* Improvement in warn-mode '@store' (for testing)Roberto Ierusalimschy2019-08-184-23/+35
| | | | | | When using warn-mode '@store', from the test library, the tests ensure not only that the expected warnings were issued, but also that there was no extra warnings.
* Added macro 'luaL_pushfail'Roberto Ierusalimschy2019-08-169-91/+91
| | | | | | | | The macro 'luaL_pushfail' documents all places in the standard libraries that return nil to signal some kind of failure. It is defined as 'lua_pushnil'. The manual also got a notation (@fail) to document those returns. The tests were changed to be agnostic regarding whether 'fail' is 'nil' or 'false'.
* Supressed errors in '__close' generate warningsRoberto Ierusalimschy2019-08-163-28/+133
|
* Added control messages to warningsRoberto Ierusalimschy2019-08-154-1/+42
| | | | | | | Added the concept of control messages to the warning system, plus the implementation of the controls "@on"/"@off" to turn warnings on/off. Moreover, the warning system in the test library adds some other controls to ease the test of warnings.
* Tracebacks recognize metamethods '__close'Roberto Ierusalimschy2019-07-311-4/+17
|
* To-be-closed variables must be closed on initializationRoberto Ierusalimschy2019-07-312-12/+22
| | | | | | | | | When initializing a to-be-closed variable, check whether it has a '__close' metamethod (or is a false value) and raise an error if if it hasn't. This produces more accurate error messages. (The check before closing still need to be done: in the C API, the value is not constant; and the object may lose its '__close' metamethod during the block.)
* Fixed test in 'main.lua'Roberto Ierusalimschy2019-07-301-7/+10
| | | | | | | The test "to-be-closed variables in main chunk" was broken, as it used the removed feature of functions as to-be-closed values. The error was not detected because its expected result had no lines to be checked (due to missing new lines).