Commit graph

5853 commits

Author SHA1 Message Date
shewitt.au
1a0d4151e8 Merge branch 'master' of https://github.com/shewitt-au/lua into msdev-build 2026-03-17 04:16:25 +11:00
Roberto I
51269bd783 Adjustment in useless parameter L in macros luai_num* 2026-03-15 15:14:14 -03:00
Roberto I
377cbea61b 'table.tunpack' using 'aux_getn' like the others
'table.tunpack' was not checking its first argument, which could
result in error messages generated inside the API, without location
information.
2026-03-09 16:24:49 -03:00
Roberto I
36d5d2b284 Details 2026-03-09 16:24:06 -03:00
Roberto I
9e501d9855 Slightly better documentation for LUAI_MAXALIGN 2026-03-09 16:23:03 -03:00
Roberto I
10eb89d114 BUG: shift overflow in utf-8 decode
An initial byte \xFF will ask for 7 continuation bytes, and then the
shift by (count * 5) will try to shift 35 bits.
2026-02-18 13:24:04 -03:00
Roberto Ierusalimschy
7c40c5edb2 Details
Spaces + added initialization to the documentation of global
declarations.
2026-02-10 16:41:02 -03:00
Roberto Ierusalimschy
b60e2bcd7c Avoid an assignment of values that overlap
The original code was like this, where t->u.ind.t and t->u.info overlap:

  t->u.ind.t = cast_byte((t->k == VLOCAL) ? t->u.var.ridx: t->u.info);
2026-02-09 13:44:27 -03:00
Roberto I
c6b4848238 Environment variable for readline library name
The name of the readline library can be changed from its default value
through environment variable LUA_READLINELIB.
2026-01-30 16:47:33 -03:00
Roberto I
efbc297545 New year and (eventual) new release 2026-01-29 14:24:25 -03:00
Roberto I
cfcaa9493b Explanation about char* parameters in the C API 2026-01-23 16:25:18 -03:00
Roberto I
3360710bd3 Another way to handle option -E
A pointer to function 'l_getenv' can point to the regular 'getenv' or
to a dumb function (that always returns NULL) to ignore environment
variables.
2026-01-22 13:47:10 -03:00
Roberto Ierusalimschy
e992c6a959 Some compilation options configurable from makefile
Compilation options LUA_COMPAT_GLOBAL, LUA_COMPAT_LOOPVAR, and
LUA_READLINELIB do not affect the API, so they can be changed
through the make file.
2026-01-20 13:06:16 -03:00
Roberto I
f5d1e8639b New compile option LUA_COMPAT_LOOPVAR
When on, this option makes for-loop control variables not read only.
2026-01-16 16:38:44 -03:00
Roberto I
2a7cf4f319 More effort in avoiding errors in finalizers
Before calling a finalizer, Lua not only checks stack limits, but
actually ensures that a minimum number of slots are already allocated
for the call. (If it cannot ensure that, it postpones the finalizer.)
That avoids finalizers not running due to memory errors that the
programmer cannot control.
2026-01-11 15:36:03 -03:00
shewitt.au
57176317db Remove file from some project view 2026-01-08 01:44:35 +11:00
shewitt.au
dac2b57cbe Move Visual Studio build files into dir 2026-01-08 01:30:22 +11:00
shewitt.au
a4902ff654 Undo so changes I made when trying to fix stuff 2026-01-07 23:37:18 +11:00
shewitt.au
21f83d5592 Fix intermediate file paths 2026-01-07 02:35:54 +11:00
shewitt.au
f2468c6af0 Add lua.h 2026-01-07 01:54:09 +11:00
shewitt.au
2851b63f42 Added temp naming convention to help find batch build issues 2026-01-07 01:50:06 +11:00
shewitt.au
6c09ee8dc2 Fixed some config/dependency issues. Still issues with batch builds 2026-01-07 01:17:29 +11:00
shewitt.au
df7f8159a0 OK. Seems to be better 2026-01-06 05:10:59 +11:00
shewitt.au
f1ff8c46cb Here's hopeing 2026-01-06 04:48:50 +11:00
shewitt.au
74aa32c0cc Fix DLL build errors 2026-01-06 02:37:49 +11:00
shewitt.au
8cf7246c89 Rename project 2026-01-06 01:54:54 +11:00
shewitt.au
286e32dc5f More changes to project settings 2026-01-06 01:27:41 +11:00
shewitt.au
6737b27b28 More changes to project settings 2026-01-06 00:53:09 +11:00
shewitt.au
3cc37d2c53 C++ builds 2026-01-05 10:29:50 +11:00
Roberto I
5cfc725a8b Special case for 'string.rep' over an empty string 2026-01-04 16:39:22 -03:00
Roberto I
45c7ae5b1b BUG: Possible overflow in 'string.packsize'
'string.packsize' can overflow result in 32-bit machines using 64-bit
integers, as LUA_MAXINTEGER may not fit into size_t.
2026-01-04 16:31:17 -03:00
Roberto I
962f444a75 Details
In an assignment like 'a = &b', is looks suspicious if 'a' has a scope
larger than 'b'.
2026-01-04 16:27:54 -03:00
shewitt.au
dbaa87e25a cli dll version 2026-01-04 22:49:56 +11:00
shewitt.au
6f5b41551b Rename targets 2026-01-04 21:37:20 +11:00
shewitt.au
6a7d37529d dll for lua core 2026-01-04 21:10:55 +11:00
shewitt.au
09ca73fd63 Static lib for lua core 2026-01-04 20:39:34 +11:00
Roberto I
c4e2c91973 Details
Some comments still talked about bit 'isrealasize', which has been
removed.
2025-12-30 10:50:49 -03:00
Roberto I
632a71b24d BUG: Arithmetic overflow in 'collectgarbage"step"'
The computation of a new debt could overflow when we give a too large
step to 'collectgarbage"step"' and the current debt was already
negative. This is only an issue if your platform cares for it or if you
compile Lua with an option like '-fsanitize=undefined'.
2025-12-27 16:22:13 -03:00
Roberto I
578ae5745c Details
typo in comment + formatting + logical 'and' was written as a bitwise
operation (makes code more fragile)
2025-12-23 14:44:06 -03:00
Roberto I
a5522f06d2 GC checks stack space before running finalizer
If the stack does not have some minimum available space, the GC defers
calling a finalizer until the next cycle. That avoids errors while
running a finalizer that the programmer cannot control.
2025-12-13 16:16:59 -03:00
Roberto I
3d03ae5bd6 'luaL_newstate' starts state with warnings on
It is easier to forget to turn them on then to turn them off.
2025-12-13 11:00:30 -03:00
Roberto I
82d721a855 Format adjust in the manual
Lists in inline code don't get a space after commas. (That keeps the
code more compact and avoids line breaks in the middle of the code.)
2025-12-10 10:35:05 -03:00
Roberto I
104b0fc700 Details
- Avoid fixing name "_ENV" in the code
- Small improvements in the manual
2025-12-08 13:09:47 -03:00
Roberto I
8164d09338 Wrong assert in 'luaK_indexed' 2025-12-08 11:08:12 -03:00
Roberto I
985ef32248 In luaB_close, running coroutines do not go to default
This should had been corrected in commit fd897027f1.
2025-12-01 10:25:44 -03:00
Roberto I
a07f6a8241 Functions with vararg tables don't need hidden args.
Vararg functions with vararg tables don't use the arguments hidden in
the stack; therfore, it doesn't need to build/keep them.
2025-11-28 15:12:51 -03:00
Roberto I
f33cc4ddec New conceptual model for vararg
Conceptually, all functions get their vararg arguments in a vararg
table. The storing of vararg arguments in the stack is always treated
as an optimization.
2025-11-26 11:18:29 -03:00
Roberto I
d94f7ba304 Details
Comments, capitalization in the manual, globals in test 'heady.lua'
2025-11-24 11:39:46 -03:00
Roberto I
4cf498210e '__pairs' can also return a to-be-closed object 2025-11-11 15:11:06 -03:00
Roberto I
5b7d998764 External strings are as good as internal ones
A '__mode' metafield and an "n" key both can be external strings.
2025-11-11 14:40:30 -03:00