aboutsummaryrefslogtreecommitdiff
path: root/testes (follow)
Commit message (Collapse)AuthorAgeFilesLines
* Big revamp in the implmentation of labels/gotosRoberto Ierusalimschy2018-10-292-14/+8
| | | | | | | | Added restriction that, when a label is created, there cannot be another label with the same name visible. That allows backward goto's to be resolved when they are read. Backward goto's get a close if they jump out of the scope of some variable; labels get a close only if previous goto to it jumps out of the scope of some upvalue.
* To-be-closed variables in the C APIRoberto Ierusalimschy2018-10-251-0/+71
|
* Closing methods should not interfere with returning valuesRoberto Ierusalimschy2018-10-251-1/+54
| | | | | | | | | | | | A closing method cannot be called in its own stack slot, as there may be returning values in the stack after that slot, and the call would corrupt those values. Instead, the closing method must be copied to the top of the stack to be called. Moreover, even when a function returns no value, its return istruction still has to have its position (which will set the stack top) after the local variables, otherwise a closing method might corrupt another not-yet-called closing method.
* Added a '__close' metamethod to file handlesRoberto Ierusalimschy2018-10-231-22/+35
|
* Removed extra information from RCS keyword strings in testsRoberto Ierusalimschy2018-10-226-4/+4
| | | | | Version numbers and dates (mostly wrong) from RCS keyword strings removed from all test files; only the file name are kept.
* Complete implementation of to-be-closed variablesRoberto Ierusalimschy2018-10-222-9/+33
|
* Handling of memory errors when creating to-be-closed upvaluesRoberto Ierusalimschy2018-10-181-6/+52
|
* First "complete" implementation of to-be-closed variablesRoberto Ierusalimschy2018-10-172-6/+72
| | | | | | | Still missing: - handling of memory errors when creating upvalue (must run closing method all the same) - interaction with coroutines
* Towards "to closed" local variablesRoberto Ierusalimschy2018-10-082-1/+14
| | | | | | | | | | | | Start of the implementation of "scoped variables" or "to be closed" variables, local variables whose '__close' (or themselves) are called when they go out of scope. This commit implements the syntax, the opcode, and the creation of the corresponding upvalue, but it still does not call the finalizations when the variable goes out of scope (the most important part). Currently, the syntax is 'local scoped name = exp', but that will probably change.
* Corrections in the implementation of '%' for floats.Roberto Ierusalimschy2018-08-281-1/+65
| | | | | | | | | The multiplication (m*b) used to test whether 'm' is non-zero and 'm' and 'b' have different signs can underflow for very small numbers, giving a wrong result. The use of explicit comparisons solves this problem. This commit also adds several new tests for '%' (both for floats and for integers) to exercise more corner cases, such as very large and very small values.
* Deprecated the emulation of '__le' using '__lt'Roberto Ierusalimschy2018-08-242-24/+18
| | | | | | | | | | | As hinted in the manual for Lua 5.3, the emulation of the metamethod for '__le' using '__le' has been deprecated. It is slow, complicates the logic, and it is easy to avoid this emulation by defining a proper '__le' function. Moreover, often this emulation was used wrongly, with a programmer assuming that an order is total when it is not (e.g., NaN in floating-point numbers).
* Added directory to test file names in '$Id:'Roberto Ierusalimschy2018-07-2529-29/+29
| | | | | | | From the point of view of 'git', all names are relative to the root directory of the project. So, file names in '$Id:' also should be relative to that directory: the proper name for test file 'all.lua' is 'testes/all.lua'.
* Fixed bug in generational collection of userdataRoberto Ierusalimschy2018-07-133-4/+87
| | | | | | | | | During generational collection, a userdatum must become gray and go to a gray list after being traversed (like tables), so that 'correctgraylist' can handle it to its next stage. This commit also added minimum tests for the generational collector, including one that would detect this bug.
* Fixed bug in line info. when using 'not' operatorRoberto Ierusalimschy2018-07-111-2/+19
| | | | | | | | | When creating code for a jump on a 'not' condition, the code generator was removing an instruction (the OP_NOT) without adjusting its corresponding line information. This fix also added tests for this case and extra functionality in the test library to debug line info. structures.
* In tests of opcodes, avoid coercion in bitwise operationRoberto Ierusalimschy2018-07-101-1/+1
|
* Fixed bug in OP_IDIVIRoberto Ierusalimschy2018-07-091-1/+12
| | | | | Opocode was using 'luai_numdiv' (float division) instead of 'luai_numidiv' (integer division).
* Added manual and tests for version 5.4-w2Roberto Ierusalimschy2018-07-0934-0/+13031