aboutsummaryrefslogtreecommitdiff
path: root/ldebug.c (follow)
Commit message (Collapse)AuthorAgeFilesLines
* Error object cannot be nilRoberto Ierusalimschy2025-02-281-1/+3
| | | | | Lua will change a nil as error object to a string message, so that it never reports an error with nil as the error object.
* DetailsRoberto Ierusalimschy2025-01-161-1/+1
| | | | New year (2024->2025), typos in comments
* OP_SELF restricted to constant short stringsRoberto Ierusalimschy2024-12-111-13/+2
| | | | | | Optimize this opcode for the common case. For long names or method calls after too many constants, operation can be coded as a move followed by 'gettable'.
* Debug information about extra arguments from __callRoberto Ierusalimschy2024-11-191-1/+9
| | | | | | 'debug.getinfo' can return number of extra arguments added to a call by a chain of __call metavalues. That information is being used to improve error messages about errors in these extra arguments.
* No errors in 'luaO_pushvfstring'Roberto Ierusalimschy2024-09-201-1/+2
| | | | | | Any call to 'va_start' must have a corresponding call to 'va_end'; so, functions called between them (luaO_pushvfstring in particular) cannot raise errors.
* Struct 'transferinfo' moved to "lua_State"Roberto Ierusalimschy2024-07-301-3/+3
| | | | | | 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.
* Added gcc option '-Wconversion'Roberto Ierusalimschy2024-07-271-2/+2
| | | | | No warnings for standard numerical types. Still pending alternative numerical types.
* 'nresults' moved into 'callstatus'Roberto Ierusalimschy2024-07-211-2/+2
| | | | That gives us more free bits in 'callstatus', for future use.
* 'isIT'/'isOT' turned from macros to functionsRoberto Ierusalimschy2024-06-271-1/+1
|
* Bug: Active-lines for stripped vararg functionsRoberto Ierusalimschy2024-06-041-17/+19
| | | | | Lua seg. faults when asked to create the 'activelines' table for a vararg function with no debug information.
* API asserts for illegal pops of to-be-closed variablesRoberto Ierusalimschy2024-03-111-0/+1
|
* Merge branch 'master' into nextversionRoberto Ierusalimschy2024-01-251-3/+2
|\
| * Bug: Yielding in a hook stops in the wrong instructionRoberto Ierusalimschy2024-01-111-3/+2
| | | | | | | | | | | | | | | | Yielding in a hook must decrease the program counter, because it already counted an instruction that, in the end, was not executed. However, that decrement should be done only when about to restart the thread. Otherwise, inspecting the thread with the debug library shows it one instruction behind of where it really is.
* | Merge branch 'master' into nextversionRoberto Ierusalimschy2023-11-071-69/+84
|\|
| * Bug: Recursion in 'getobjname' can stack overflowRoberto Ierusalimschy2023-11-011-69/+84
| | | | | | | | | | | | 'getobjname' now broken in two, a basic version that handles locals, upvalues, and constants, and a full version, which uses the basic version to handle table accesses (globals and fields).
* | New macro 'getlstr'Roberto Ierusalimschy2023-08-301-4/+6
| | | | | | | | Accesses content and length of a 'TString'.
* | Field 'Proto.is_vararg' uses only one bitRoberto Ierusalimschy2023-08-301-4/+4
|/ | | | So that the other bits can be used for other purposes.
* More disciplined use of 'getstr' and 'tsslen'Roberto Ierusalimschy2023-08-171-3/+3
| | | | | We may want to add other string variants in the future; this change documents better where the code may need to handle those variants.
* Bug: Call hook may be called twice when count hook yieldsRoberto Ierusalimschy2023-07-251-0/+22
| | | | | Took the opportunity and moved the code that controls call hooks in 'luaV_execute' into a function.
* Detailsv5.4.5Roberto Ierusalimschy2023-04-181-2/+2
| | | | Typos in comments and details in the manual.
* More orderliness in casts of enumerationsRoberto Ierusalimschy2023-03-271-13/+16
|
* Stack indices changed to union'sRoberto Ierusalimschy2022-10-291-26/+26
| | | | | That will allow to change pointers to offsets while reallocating the stack.
* Save stack space while handling errorsRoberto Ierusalimschy2022-05-201-1/+4
| | | | | | | | | | Because error handling (luaG_errormsg) uses slots from EXTRA_STACK, and some errors can recur (e.g., string overflow while creating an error message in 'luaG_runerror', or a C-stack overflow before calling the message handler), the code should use stack slots with parsimony. This commit fixes the bug "Lua-stack overflow when C stack overflows while handling an error".
* Fix debug information about finalizersRoberto Ierusalimschy2021-12-141-23/+31
| | | | | | The flag CIST_FIN does not mark a finalizer, but the function that was running when the finalizer was called. (So, the function did not call the finalizer, but it looks that way in the stack.)
* Wrong assert in 'collectvalidlines'Roberto Ierusalimschy2021-11-251-1/+1
|
* Avoid OP_VARARGPREP for active linesRoberto Ierusalimschy2021-11-101-1/+8
| | | | | when building the table 'activelines' for a vararg function, this first instruction does not make the first line active.
* DocumentationRoberto Ierusalimschy2021-10-111-1/+1
| | | | | Better explanation about the guaranties of multiple assignment in the manual.
* Align error messages for calling non-callable valuesRoberto Ierusalimschy2021-04-121-11/+37
| | | | | 'pcall(foo)' message was "attempt to call a table value", while 'pcall(function () foo() end) message was "global 'foo' is not callable".
* Wrong assertion in 'getbaseline'Roberto Ierusalimschy2021-03-051-1/+4
| | | | | The assertion cannot compute 'f->abslineinfo[i]' when the initial estimate 'i' is -1.
* Bug (kind of) in 'isinstack'Roberto Ierusalimschy2021-02-251-6/+10
| | | | | | | The function 'isinstack' tried to work around the undefined behavior of subtracting two pointers that do not point to the same object, but the compiler killed to trick. (It optimizes out the safety check, because in a correct execution it will be always true.)
* Don't use tointegerns when luaV_tointegerns will doRoberto Ierusalimschy2021-02-241-1/+1
| | | | | | | | Some places don't need the "fast path" macro tointegerns, either because speed is not essential (lcode.c) or because the value is not supposed to be an integer already (luaV_equalobj and luaG_tointerror). Moreover, luaV_equalobj should always use F2Ieq, even if Lua is compiled to "round to floor".
* Optimization/simplification of 'getbaseline'Roberto Ierusalimschy2021-02-021-20/+15
| | | | | By producing absolute line information at regular intervals, a simple division can compute the correct entry for a given instruction.
* Optimizations for line hookRoberto Ierusalimschy2021-01-281-20/+32
| | | | | The function 'changedline' tries harder to avoid calling 'luaG_getfuncline' plus small changes in the use of 'L->oldpc'.
* Better error messages for calling non-callable objectsRoberto Ierusalimschy2020-12-291-6/+17
| | | | | | | When available, use the calling code to find a suitable name for what was being called; this is particularly useful for errors of non-callable metamethods. This commit also improved the debug information for order metamethods.
* Fixed bug: line hooks in stripped functionsRoberto Ierusalimschy2020-07-271-1/+3
| | | | | Line-hook handling was accessing debug info. without checking whether it was present.
* Fixed bug: Negation overflow in getlocal/setlocalRoberto Ierusalimschy2020-07-271-3/+3
|
* Fixed bug: invalid 'oldpc' when returning to a functionRoberto Ierusalimschy2020-07-171-16/+25
| | | | | | | | | | The field 'L->oldpc' is not always updated when control returns to a function; an invalid value can seg. fault when computing 'changedline'. (One example is an error in a finalizer; control can return to 'luaV_execute' without executing 'luaD_poscall'.) Instead of trying to fix all possible corner cases, it seems safer to be resilient to invalid values for 'oldpc'. Valid but wrong values at most cause an extra call to a line hook.
* Improvements in the handling of signalsRoberto Ierusalimschy2020-05-221-9/+11
| | | | Added 'volatile' to 'l_signalT' variables plus some minor changes.
* DetailsRoberto Ierusalimschy2020-02-271-3/+3
| | | | | Several details in code (e.g., moving a variable to the most inner scope that encloses its uses), comments, parameter names, extra tests.
* Clearer distinction between types and tagsRoberto Ierusalimschy2020-01-311-1/+1
| | | | | LUA_T* represents only types; tags (types + Variants) are represented by LUA_V* constants.
* Changed internal representation of booleansRoberto Ierusalimschy2020-01-061-1/+1
| | | | | | | 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.)
* Added macro 'testMMMode'Roberto Ierusalimschy2019-09-061-5/+3
| | | | Macro 'testMMMode' checks whether opcode is an MM opcode.
* Use of 'MMBIN' opcodes extended to shift operatorsRoberto Ierusalimschy2019-08-281-8/+0
| | | | Plus, this commit removes useless 'tm' parameters in 'op_*' macros.
* First version of OP_MMBIN opcodesRoberto Ierusalimschy2019-08-271-14/+7
| | | | | | | | | | | 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.)
* Tracebacks recognize metamethods '__close'Roberto Ierusalimschy2019-07-311-0/+3
|
* DetailsRoberto Ierusalimschy2019-06-031-2/+3
| | | | | Several small changes from feedback on 5.4 alhpa rc1 (warnings, typos in the manual, and the like)
* Added field 'srclen' to structure 'lua_Debug'Roberto Ierusalimschy2019-04-041-3/+11
| | | | | | This new field gets the length of 'source' in the same structure. Unlike the other strings in that structure, 'source' can be relatively large, and Lua already has its length readily available.
* A to-be-closed variable must have a closable value (or be nil)Roberto Ierusalimschy2018-11-291-8/+10
| | | | | | | It is an error for a to-be-closed variable to have a non-closable non-nil value when it is being closed. This situation does not seem to be useful and often hints to an error. (Particularly in the C API, it is easy to change a to-be-closed index by mistake.)
* Added opcodes for arithmetic with K operandsRoberto Ierusalimschy2018-11-231-2/+8
| | | | | | | | Added opcodes for all seven arithmetic operators with K operands (that is, operands that are numbers in the array of constants of the function). They cover the cases of constant float operands (e.g., 'x + .0.0', 'x^0.5') and large integer operands (e.g., 'x % 10000').
* Better error messages for invalid operands in numeric 'for'Roberto Ierusalimschy2018-10-301-0/+6
| | | | | | "Better" and similar to error messages for invalid function arguments. *old message: 'for' limit must be a number *new message: bad 'for' limit (number expected, got table)