diff -Nr lua-5.5.0/Makefile lua-5.5.1/Makefile 39c39 < PLATS= guess aix bsd c89 freebsd generic ios linux macosx mingw posix solaris --- > PLATS= guess aix bsd c89 freebsd generic ios linux linux-readline macosx mingw posix solaris 49c49 < R= $V.0 --- > R= $V.1 diff -Nr lua-5.5.0/README lua-5.5.1/README 2c2 < This is Lua 5.5.0, released on 15 Dec 2025. --- > This is Lua 5.5.1, released on 24 Jul 2026. diff -Nr lua-5.5.0/doc/contents.html lua-5.5.1/doc/contents.html 35c35 < Copyright © 2020–2025 Lua.org, PUC-Rio. --- > Copyright © 2020–2026 Lua.org, PUC-Rio. 708c708 < Thu Dec 4 17:32:26 UTC 2025 --- > Mon Jul 13 21:19:58 UTC 2026 711c711 < Last change: revised for Lua 5.5.0 --- > Last change: revised for Lua 5.5.1 diff -Nr lua-5.5.0/doc/manual.css lua-5.5.1/doc/manual.css 9a10,13 > pre.api { > white-space: normal ; > } > diff -Nr lua-5.5.0/doc/manual.html lua-5.5.1/doc/manual.html 22c22 < Copyright © 2020–2025 Lua.org, PUC-Rio. --- > Copyright © 2020–2026 Lua.org, PUC-Rio. 2103c2103 < foo() -- 'foo' can freely change any global --- > foo() -- 'foo' can freely change any global 3266c3266,3280 < Several functions in the API return pointers (const char*) --- > Several functions in the API have parameters > that are pointers to C strings (const char*). > Some of these parameters have an associated length (size_t). > Unless stated otherwise, > when there is an associated length, > the string can contain embedded zeros; > moreover, the pointer can be NULL if the length is zero. > When there is no associated length, > the pointer must point to a zero-terminated string. > In any case, the string contents should remain unchanged > until the function returns. > > >

> Several functions in the API also return pointers (const char*) 3675c3689 <

int lua_absindex (lua_State *L, int idx);
--- >
int lua_absindex (lua_State *L, int idx);
3687c3701 <
typedef void * (*lua_Alloc) (void *ud,
---
> 
typedef void * (*lua_Alloc) (void *ud,
3766c3780
< 
void lua_arith (lua_State *L, int op);
--- >
void lua_arith (lua_State *L, int op);
3805c3819 <
lua_CFunction lua_atpanic (lua_State *L, lua_CFunction panicf);
--- >
lua_CFunction lua_atpanic (lua_State *L, lua_CFunction panicf);
3816c3830 <
void lua_call (lua_State *L, int nargs, int nresults);
--- >
void lua_call (lua_State *L, int nargs, int nresults);
3889c3903 <
void lua_callk (lua_State *L,
---
> 
void lua_callk (lua_State *L,
3904c3918
< 
typedef int (*lua_CFunction) (lua_State *L);
--- >
typedef int (*lua_CFunction) (lua_State *L);
3956c3970 <
int lua_checkstack (lua_State *L, int n);
--- >
int lua_checkstack (lua_State *L, int n);
3976c3990 <
void lua_close (lua_State *L);
--- >
void lua_close (lua_State *L);
3998c4012 <
void lua_closeslot (lua_State *L, int index);
--- >
void lua_closeslot (lua_State *L, int index);
4016c4030 <
int lua_closethread (lua_State *L, lua_State *from);
--- >
int lua_closethread (lua_State *L, lua_State *from);
4051c4065 <
int lua_compare (lua_State *L, int index1, int index2, int op);
--- >
int lua_compare (lua_State *L, int index1, int index2, int op);
4079c4093 <
void lua_concat (lua_State *L, int n);
--- >
void lua_concat (lua_State *L, int n);
4096c4110 <
void lua_copy (lua_State *L, int fromidx, int toidx);
--- >
void lua_copy (lua_State *L, int fromidx, int toidx);
4110c4124 <
void lua_createtable (lua_State *L, int nseq, int nrec);
--- >
void lua_createtable (lua_State *L, int nseq, int nrec);
4129c4143 <
int lua_dump (lua_State *L,
---
> 
int lua_dump (lua_State *L,
4173c4187
< 
int lua_error (lua_State *L);
--- >
int lua_error (lua_State *L);
4188c4202 <
int lua_gc (lua_State *L, int what, ...);
--- >
int lua_gc (lua_State *L, int what, ...);
4273c4287 <
lua_Alloc lua_getallocf (lua_State *L, void **ud);
--- >
lua_Alloc lua_getallocf (lua_State *L, void **ud);
4286c4300 <
int lua_getfield (lua_State *L, int index, const char *k);
--- >
int lua_getfield (lua_State *L, int index, const char *k);
4304c4318 <
void *lua_getextraspace (lua_State *L);
--- >
void *lua_getextraspace (lua_State *L);
4329c4343 <
int lua_getglobal (lua_State *L, const char *name);
--- >
int lua_getglobal (lua_State *L, const char *name);
4341c4355 <
int lua_geti (lua_State *L, int index, lua_Integer i);
--- >
int lua_geti (lua_State *L, int index, lua_Integer i);
4359c4373 <
int lua_getmetatable (lua_State *L, int index);
--- >
int lua_getmetatable (lua_State *L, int index);
4373c4387 <
int lua_gettable (lua_State *L, int index);
--- >
int lua_gettable (lua_State *L, int index);
4397c4411 <
int lua_gettop (lua_State *L);
--- >
int lua_gettop (lua_State *L);
4411c4425 <
int lua_getiuservalue (lua_State *L, int index, int n);
--- >
int lua_getiuservalue (lua_State *L, int index, int n);
4429c4443 <
void lua_insert (lua_State *L, int index);
--- >
void lua_insert (lua_State *L, int index);
4442c4456 <
typedef ... lua_Integer;
--- >
typedef ... lua_Integer;
4467c4481 <
int lua_isboolean (lua_State *L, int index);
--- >
int lua_isboolean (lua_State *L, int index);
4479c4493 <
int lua_iscfunction (lua_State *L, int index);
--- >
int lua_iscfunction (lua_State *L, int index);
4491c4505 <
int lua_isfunction (lua_State *L, int index);
--- >
int lua_isfunction (lua_State *L, int index);
4503c4517 <
int lua_isinteger (lua_State *L, int index);
--- >
int lua_isinteger (lua_State *L, int index);
4516c4530 <
int lua_islightuserdata (lua_State *L, int index);
--- >
int lua_islightuserdata (lua_State *L, int index);
4528c4542 <
int lua_isnil (lua_State *L, int index);
--- >
int lua_isnil (lua_State *L, int index);
4540c4554 <
int lua_isnone (lua_State *L, int index);
--- >
int lua_isnone (lua_State *L, int index);
4552c4566 <
int lua_isnoneornil (lua_State *L, int index);
--- >
int lua_isnoneornil (lua_State *L, int index);
4565c4579 <
int lua_isnumber (lua_State *L, int index);
--- >
int lua_isnumber (lua_State *L, int index);
4578c4592 <
int lua_isstring (lua_State *L, int index);
--- >
int lua_isstring (lua_State *L, int index);
4591c4605 <
int lua_istable (lua_State *L, int index);
--- >
int lua_istable (lua_State *L, int index);
4603c4617 <
int lua_isthread (lua_State *L, int index);
--- >
int lua_isthread (lua_State *L, int index);
4615c4629 <
int lua_isuserdata (lua_State *L, int index);
--- >
int lua_isuserdata (lua_State *L, int index);
4627c4641 <
int lua_isyieldable (lua_State *L);
--- >
int lua_isyieldable (lua_State *L);
4638c4652 <
typedef ... lua_KContext;
--- >
typedef ... lua_KContext;
4653c4667 <
typedef int (*lua_KFunction) (lua_State *L, int status, lua_KContext ctx);
--- >
typedef int (*lua_KFunction) (lua_State *L, int status, lua_KContext ctx);
4664c4678 <
void lua_len (lua_State *L, int index);
--- >
void lua_len (lua_State *L, int index);
4678c4692 <
int lua_load (lua_State *L,
---
> 
int lua_load (lua_State *L,
4758c4772
< 
lua_State *lua_newstate (lua_Alloc f, void *ud,
---
> 
lua_State *lua_newstate (lua_Alloc f, void *ud,
4779c4793
< 
void lua_newtable (lua_State *L);
--- >
void lua_newtable (lua_State *L);
4791c4805 <
lua_State *lua_newthread (lua_State *L);
--- >
lua_State *lua_newthread (lua_State *L);
4811c4825 <
void *lua_newuserdatauv (lua_State *L, size_t size, int nuvalue);
--- >
void *lua_newuserdatauv (lua_State *L, size_t size, int nuvalue);
4817,4818c4831,4838 < (The user values can be set and read with the functions < lua_setiuservalue and lua_getiuservalue.) --- > > >

> The user values can be set and read with the functions > lua_setiuservalue and lua_getiuservalue. > The block of memory is suitably aligned for any ISO C object. > (See macro LUAI_MAXALIGN in file luaconf.h for other > alignment requirements.) 4834c4854 <

int lua_next (lua_State *L, int index);
--- >
int lua_next (lua_State *L, int index);
4872,4873c4892,4895 < See function next for the caveats of modifying < the table during its traversal. --- > > >

> See function next for more details about the traversal. 4880c4902 <

typedef ... lua_Number;
--- >
typedef ... lua_Number;
4896c4918 <
int lua_numbertointeger (lua_Number n, lua_Integer *p);
--- >
int lua_numbertointeger (lua_Number n, lua_Integer *p);
4918c4940 <
unsigned lua_numbertocstring (lua_State *L, int idx,
---
> 
unsigned lua_numbertocstring (lua_State *L, int idx,
4936c4958
< 
int lua_pcall (lua_State *L, int nargs, int nresults, int msgh);
--- >
int lua_pcall (lua_State *L, int nargs, int nresults, int msgh);
4986c5008 <
int lua_pcallk (lua_State *L,
---
> 
int lua_pcallk (lua_State *L,
5003c5025
< 
void lua_pop (lua_State *L, int n);
--- >
void lua_pop (lua_State *L, int n);
5015c5037 <
void lua_pushboolean (lua_State *L, int b);
--- >
void lua_pushboolean (lua_State *L, int b);
5026c5048 <
void lua_pushcclosure (lua_State *L, lua_CFunction fn, int n);
--- >
void lua_pushcclosure (lua_State *L, lua_CFunction fn, int n);
5075c5097 <
void lua_pushcfunction (lua_State *L, lua_CFunction f);
--- >
void lua_pushcfunction (lua_State *L, lua_CFunction f);
5087c5109 <
const char *lua_pushexternalstring (lua_State *L,
---
> 
const char *lua_pushexternalstring (lua_State *L,
5129c5151
< 
const char *lua_pushfstring (lua_State *L, const char *fmt, ...);
--- >
const char *lua_pushfstring (lua_State *L, const char *fmt, ...);
5163c5185 <
void lua_pushglobaltable (lua_State *L);
--- >
void lua_pushglobaltable (lua_State *L);
5174c5196 <
void lua_pushinteger (lua_State *L, lua_Integer n);
--- >
void lua_pushinteger (lua_State *L, lua_Integer n);
5185c5207 <
void lua_pushlightuserdata (lua_State *L, void *p);
--- >
void lua_pushlightuserdata (lua_State *L, void *p);
5206c5228 <
const char *lua_pushliteral (lua_State *L, const char *s);
--- >
const char *lua_pushliteral (lua_State *L, const char *s);
5219c5241 <
const char *lua_pushlstring (lua_State *L, const char *s, size_t len);
--- >
const char *lua_pushlstring (lua_State *L, const char *s, size_t len);
5245c5267 <
void lua_pushnil (lua_State *L);
--- >
void lua_pushnil (lua_State *L);
5256c5278 <
void lua_pushnumber (lua_State *L, lua_Number n);
--- >
void lua_pushnumber (lua_State *L, lua_Number n);
5267c5289 <
const char *lua_pushstring (lua_State *L, const char *s);
--- >
const char *lua_pushstring (lua_State *L, const char *s);
5290c5312 <
int lua_pushthread (lua_State *L);
--- >
int lua_pushthread (lua_State *L);
5302c5324 <
void lua_pushvalue (lua_State *L, int index);
--- >
void lua_pushvalue (lua_State *L, int index);
5314c5336 <
const char *lua_pushvfstring (lua_State *L,
---
> 
const char *lua_pushvfstring (lua_State *L,
5332c5354
< 
int lua_rawequal (lua_State *L, int index1, int index2);
--- >
int lua_rawequal (lua_State *L, int index1, int index2);
5347c5369 <
int lua_rawget (lua_State *L, int index);
--- >
int lua_rawget (lua_State *L, int index);
5360c5382 <
int lua_rawgeti (lua_State *L, int index, lua_Integer n);
--- >
int lua_rawgeti (lua_State *L, int index, lua_Integer n);
5378c5400 <
int lua_rawgetp (lua_State *L, int index, const void *p);
--- >
int lua_rawgetp (lua_State *L, int index, const void *p);
5397c5419 <
lua_Unsigned lua_rawlen (lua_State *L, int index);
--- >
lua_Unsigned lua_rawlen (lua_State *L, int index);
5414c5436 <
void lua_rawset (lua_State *L, int index);
--- >
void lua_rawset (lua_State *L, int index);
5427c5449 <
void lua_rawseti (lua_State *L, int index, lua_Integer i);
--- >
void lua_rawseti (lua_State *L, int index, lua_Integer i);
5446c5468 <
void lua_rawsetp (lua_State *L, int index, const void *p);
--- >
void lua_rawsetp (lua_State *L, int index, const void *p);
5465c5487 <
typedef const char * (*lua_Reader) (lua_State *L,
---
> 
typedef const char * (*lua_Reader) (lua_State *L,
5488c5510
< 
void lua_register (lua_State *L, const char *name, lua_CFunction f);
--- >
void lua_register (lua_State *L, const char *name, lua_CFunction f);
5504c5526 <
void lua_remove (lua_State *L, int index);
--- >
void lua_remove (lua_State *L, int index);
5518c5540 <
void lua_replace (lua_State *L, int index);
--- >
void lua_replace (lua_State *L, int index);
5532c5554 <
int lua_resume (lua_State *L, lua_State *from, int nargs,
---
> 
int lua_resume (lua_State *L, lua_State *from, int nargs,
5543c5565
< then you call lua_resume,
---
> Then you call lua_resume,
5581c5603
< 
void lua_rotate (lua_State *L, int idx, int n);
--- >
void lua_rotate (lua_State *L, int idx, int n);
5601c5623 <
void lua_setallocf (lua_State *L, lua_Alloc f, void *ud);
--- >
void lua_setallocf (lua_State *L, lua_Alloc f, void *ud);
5613c5635 <
void lua_setfield (lua_State *L, int index, const char *k);
--- >
void lua_setfield (lua_State *L, int index, const char *k);
5632c5654 <
void lua_setglobal (lua_State *L, const char *name);
--- >
void lua_setglobal (lua_State *L, const char *name);
5644c5666 <
void lua_seti (lua_State *L, int index, lua_Integer n);
--- >
void lua_seti (lua_State *L, int index, lua_Integer n);
5663c5685 <
int lua_setiuservalue (lua_State *L, int index, int n);
--- >
int lua_setiuservalue (lua_State *L, int index, int n);
5677c5699 <
int lua_setmetatable (lua_State *L, int index);
--- >
int lua_setmetatable (lua_State *L, int index);
5695c5717 <
void lua_settable (lua_State *L, int index);
--- >
void lua_settable (lua_State *L, int index);
5715c5737 <
void lua_settop (lua_State *L, int index);
--- >
void lua_settop (lua_State *L, int index);
5735c5757 <
void lua_setwarnf (lua_State *L, lua_WarnFunction f, void *ud);
--- >
void lua_setwarnf (lua_State *L, lua_WarnFunction f, void *ud);
5748c5770 <
typedef struct lua_State lua_State;
--- >
typedef struct lua_State lua_State;
5769c5791 <
int lua_status (lua_State *L);
--- >
int lua_status (lua_State *L);
5793,5794c5815,5816 < [-0, +1, –] <
size_t lua_stringtonumber (lua_State *L, const char *s);
--- > [-0, +(0|1), –] >
size_t lua_stringtonumber (lua_State *L, const char *s);
5815c5837 <
int lua_toboolean (lua_State *L, int index);
--- >
int lua_toboolean (lua_State *L, int index);
5833c5855 <
lua_CFunction lua_tocfunction (lua_State *L, int index);
--- >
lua_CFunction lua_tocfunction (lua_State *L, int index);
5846c5868 <
void lua_toclose (lua_State *L, int index);
--- >
void lua_toclose (lua_State *L, int index);
5888c5910 <
lua_Integer lua_tointeger (lua_State *L, int index);
--- >
lua_Integer lua_tointeger (lua_State *L, int index);
5899c5921 <
lua_Integer lua_tointegerx (lua_State *L, int index, int *isnum);
--- >
lua_Integer lua_tointegerx (lua_State *L, int index, int *isnum);
5920c5942 <
const char *lua_tolstring (lua_State *L, int index, size_t *len);
--- >
const char *lua_tolstring (lua_State *L, int index, size_t *len);
5958c5980 <
lua_Number lua_tonumber (lua_State *L, int index);
--- >
lua_Number lua_tonumber (lua_State *L, int index);
5969c5991 <
lua_Number lua_tonumberx (lua_State *L, int index, int *isnum);
--- >
lua_Number lua_tonumberx (lua_State *L, int index, int *isnum);
5990c6012 <
const void *lua_topointer (lua_State *L, int index);
--- >
const void *lua_topointer (lua_State *L, int index);
6010c6032 <
const char *lua_tostring (lua_State *L, int index);
--- >
const char *lua_tostring (lua_State *L, int index);
6021c6043 <
lua_State *lua_tothread (lua_State *L, int index);
--- >
lua_State *lua_tothread (lua_State *L, int index);
6035c6057 <
void *lua_touserdata (lua_State *L, int index);
--- >
void *lua_touserdata (lua_State *L, int index);
6050c6072 <
int lua_type (lua_State *L, int index);
--- >
int lua_type (lua_State *L, int index);
6074c6096 <
const char *lua_typename (lua_State *L, int tp);
--- >
const char *lua_typename (lua_State *L, int tp);
6085c6107 <
typedef ... lua_Unsigned;
--- >
typedef ... lua_Unsigned;
6096c6118 <
int lua_upvalueindex (int i);
--- >
int lua_upvalueindex (int i);
6109c6131 <
lua_Number lua_version (lua_State *L);
--- >
lua_Number lua_version (lua_State *L);
6119c6141 <
typedef void (*lua_WarnFunction) (void *ud, const char *msg, int tocont);
--- >
typedef void (*lua_WarnFunction) (void *ud, const char *msg, int tocont);
6140c6162 <
void lua_warning (lua_State *L, const char *msg, int tocont);
--- >
void lua_warning (lua_State *L, const char *msg, int tocont);
6156c6178 <
typedef int (*lua_Writer) (lua_State *L,
---
> 
typedef int (*lua_Writer) (lua_State *L,
6188c6210
< 
void lua_xmove (lua_State *from, lua_State *to, int n);
--- >
void lua_xmove (lua_State *from, lua_State *to, int n);
6204c6226 <
int lua_yield (lua_State *L, int nresults);
--- >
int lua_yield (lua_State *L, int nresults);
6221c6243 <
int lua_yieldk (lua_State *L,
---
> 
int lua_yieldk (lua_State *L,
6244c6266
< with the n results removed and
---
> with all the results (nresults) removed and
6345c6367
< The length of the string source.
---
> the length of the string source.
6445c6467
< 
lua_Hook lua_gethook (lua_State *L);
--- >
lua_Hook lua_gethook (lua_State *L);
6456c6478 <
int lua_gethookcount (lua_State *L);
--- >
int lua_gethookcount (lua_State *L);
6467c6489 <
int lua_gethookmask (lua_State *L);
--- >
int lua_gethookmask (lua_State *L);
6478c6500 <
int lua_getinfo (lua_State *L, const char *what, lua_Debug *ar);
--- >
int lua_getinfo (lua_State *L, const char *what, lua_Debug *ar);
6531c6553 < fills in the fields source, short_src, --- > fills in the fields source, srclen, short_src, 6564c6586 <
const char *lua_getlocal (lua_State *L, const lua_Debug *ar, int n);
--- >
const char *lua_getlocal (lua_State *L, const lua_Debug *ar, int n);
6605c6627 <
int lua_getstack (lua_State *L, int level, lua_Debug *ar);
--- >
int lua_getstack (lua_State *L, int level, lua_Debug *ar);
6628c6650 <
const char *lua_getupvalue (lua_State *L, int funcindex, int n);
--- >
const char *lua_getupvalue (lua_State *L, int funcindex, int n);
6647c6669 <
typedef void (*lua_Hook) (lua_State *L, lua_Debug *ar);
--- >
typedef void (*lua_Hook) (lua_State *L, lua_Debug *ar);
6696c6718 <
void lua_sethook (lua_State *L, lua_Hook f, int mask, int count);
--- >
void lua_sethook (lua_State *L, lua_Hook f, int mask, int count);
6746c6768 <
const char *lua_setlocal (lua_State *L, const lua_Debug *ar, int n);
--- >
const char *lua_setlocal (lua_State *L, const lua_Debug *ar, int n);
6762c6784,6786 < Parameters ar and n are as in the function lua_getlocal. --- > Parameters ar and n are as in the function lua_getlocal, > except that ar cannot be NULL, > as lua_setlocal only operates on activation records. 6770c6794 <
const char *lua_setupvalue (lua_State *L, int funcindex, int n);
--- >
const char *lua_setupvalue (lua_State *L, int funcindex, int n);
6794c6818 <
void *lua_upvalueid (lua_State *L, int funcindex, int n);
--- >
void *lua_upvalueid (lua_State *L, int funcindex, int n);
6820c6844 <
void lua_upvaluejoin (lua_State *L, int funcindex1, int n1,
---
> 
void lua_upvaluejoin (lua_State *L, int funcindex1, int n1,
6895c6919
< 
void luaL_addchar (luaL_Buffer *B, char c);
--- >
void luaL_addchar (luaL_Buffer *B, char c);
6907c6931 <
const void luaL_addgsub (luaL_Buffer *B, const char *s,
---
> 
const void luaL_addgsub (luaL_Buffer *B, const char *s,
6921c6945
< 
void luaL_addlstring (luaL_Buffer *B, const char *s, size_t l);
--- >
void luaL_addlstring (luaL_Buffer *B, const char *s, size_t l);
6935c6959 <
void luaL_addsize (luaL_Buffer *B, size_t n);
--- >
void luaL_addsize (luaL_Buffer *B, size_t n);
6948c6972 <
void luaL_addstring (luaL_Buffer *B, const char *s);
--- >
void luaL_addstring (luaL_Buffer *B, const char *s);
6961c6985 <
void luaL_addvalue (luaL_Buffer *B);
--- >
void luaL_addvalue (luaL_Buffer *B);
6981c7005 <
void luaL_argcheck (lua_State *L,
---
> 
void luaL_argcheck (lua_State *L,
6996c7020
< 
int luaL_argerror (lua_State *L, int arg, const char *extramsg);
--- >
int luaL_argerror (lua_State *L, int arg, const char *extramsg);
7015c7039 <
void luaL_argexpected (lua_State *L,
---
> 
void luaL_argexpected (lua_State *L,
7030c7054
< 
typedef struct luaL_Buffer luaL_Buffer;
--- >
typedef struct luaL_Buffer luaL_Buffer;
7102c7126 <
char *luaL_buffaddr (luaL_Buffer *B);
--- >
char *luaL_buffaddr (luaL_Buffer *B);
7115c7139 <
void luaL_buffinit (lua_State *L, luaL_Buffer *B);
--- >
void luaL_buffinit (lua_State *L, luaL_Buffer *B);
7129c7153 <
size_t luaL_bufflen (luaL_Buffer *B);
--- >
size_t luaL_bufflen (luaL_Buffer *B);
7141c7165 <
char *luaL_buffinitsize (lua_State *L, luaL_Buffer *B, size_t sz);
--- >
char *luaL_buffinitsize (lua_State *L, luaL_Buffer *B, size_t sz);
7153c7177 <
void luaL_buffsub (luaL_Buffer *B, int n);
--- >
void luaL_buffsub (luaL_Buffer *B, int n);
7166c7190 <
int luaL_callmeta (lua_State *L, int obj, const char *e);
--- >
int luaL_callmeta (lua_State *L, int obj, const char *e);
7187c7211 <
void luaL_checkany (lua_State *L, int arg);
--- >
void luaL_checkany (lua_State *L, int arg);
7199c7223 <
lua_Integer luaL_checkinteger (lua_State *L, int arg);
--- >
lua_Integer luaL_checkinteger (lua_State *L, int arg);
7212c7236 <
const char *luaL_checklstring (lua_State *L, int arg, size_t *l);
--- >
const char *luaL_checklstring (lua_State *L, int arg, size_t *l);
7231c7255 <
lua_Number luaL_checknumber (lua_State *L, int arg);
--- >
lua_Number luaL_checknumber (lua_State *L, int arg);
7243c7267 <
int luaL_checkoption (lua_State *L,
---
> 
int luaL_checkoption (lua_State *L,
7274c7298
< 
void luaL_checkstack (lua_State *L, int sz, const char *msg);
--- >
void luaL_checkstack (lua_State *L, int sz, const char *msg);
7288c7312 <
const char *luaL_checkstring (lua_State *L, int arg);
--- >
const char *luaL_checkstring (lua_State *L, int arg);
7305c7329 <
void luaL_checktype (lua_State *L, int arg, int t);
--- >
void luaL_checktype (lua_State *L, int arg, int t);
7317c7341 <
void *luaL_checkudata (lua_State *L, int arg, const char *tname);
--- >
void *luaL_checkudata (lua_State *L, int arg, const char *tname);
7330c7354 <
void luaL_checkversion (lua_State *L);
--- >
void luaL_checkversion (lua_State *L);
7342c7366 <
int luaL_dofile (lua_State *L, const char *filename);
--- >
int luaL_dofile (lua_State *L, const char *filename);
7361c7385 <
int luaL_dostring (lua_State *L, const char *str);
--- >
int luaL_dostring (lua_State *L, const char *str);
7379c7403 <
int luaL_error (lua_State *L, const char *fmt, ...);
--- >
int luaL_error (lua_State *L, const char *fmt, ...);
7402c7426 <
int luaL_execresult (lua_State *L, int stat);
--- >
int luaL_execresult (lua_State *L, int stat);
7415c7439 <
int luaL_fileresult (lua_State *L, int stat, const char *fname);
--- >
int luaL_fileresult (lua_State *L, int stat, const char *fname);
7428c7452 <
int luaL_getmetafield (lua_State *L, int obj, const char *e);
--- >
int luaL_getmetafield (lua_State *L, int obj, const char *e);
7443c7467 <
int luaL_getmetatable (lua_State *L, const char *tname);
--- >
int luaL_getmetatable (lua_State *L, const char *tname);
7457c7481 <
int luaL_getsubtable (lua_State *L, int idx, const char *fname);
--- >
int luaL_getsubtable (lua_State *L, int idx, const char *fname);
7473c7497 <
const char *luaL_gsub (lua_State *L,
---
> 
const char *luaL_gsub (lua_State *L,
7490c7514
< 
lua_Integer luaL_len (lua_State *L, int index);
--- >
lua_Integer luaL_len (lua_State *L, int index);
7505c7529 <
int luaL_loadbuffer (lua_State *L,
---
> 
int luaL_loadbuffer (lua_State *L,
7519c7543
< 
int luaL_loadbufferx (lua_State *L,
---
> 
int luaL_loadbufferx (lua_State *L,
7545c7569
< 
int luaL_loadfile (lua_State *L, const char *filename);
--- >
int luaL_loadfile (lua_State *L, const char *filename);
7556c7580 <
int luaL_loadfilex (lua_State *L, const char *filename,
---
> 
int luaL_loadfilex (lua_State *L, const char *filename,
7587c7611
< 
int luaL_loadstring (lua_State *L, const char *s);
--- >
int luaL_loadstring (lua_State *L, const char *s);
7609c7633 <
unsigned int luaL_makeseed (lua_State *L);
--- >
unsigned int luaL_makeseed (lua_State *L);
7622c7646 <
void luaL_newlib (lua_State *L, const luaL_Reg l[]);
--- >
void luaL_newlib (lua_State *L, const luaL_Reg l[]);
7644c7668 <
void luaL_newlibtable (lua_State *L, const luaL_Reg l[]);
--- >
void luaL_newlibtable (lua_State *L, const luaL_Reg l[]);
7665c7689 <
int luaL_newmetatable (lua_State *L, const char *tname);
--- >
int luaL_newmetatable (lua_State *L, const char *tname);
7682a7707,7716 >

> Usage note: Beware the use of the return value of this function to > conditionally initializes the new metatable > (e.g., by adding metamethods to it). > If the initialization raises an error, > the metatable will not be properly initialized, > but a subsequent execution of that code will detect that the > metatable already exists and then skip the initialization. > > 7688c7722 <

lua_State *luaL_newstate (void);
--- >
lua_State *luaL_newstate (void);
7709c7743 <
T luaL_opt (L, func, arg, dflt);
--- >
T luaL_opt (L, func, arg, dflt);
7730c7764 <
lua_Integer luaL_optinteger (lua_State *L,
---
> 
lua_Integer luaL_optinteger (lua_State *L,
7748c7782
< 
const char *luaL_optlstring (lua_State *L,
---
> 
const char *luaL_optlstring (lua_State *L,
7779c7813
< 
lua_Number luaL_optnumber (lua_State *L, int arg, lua_Number d);
--- >
lua_Number luaL_optnumber (lua_State *L, int arg, lua_Number d);
7794c7828 <
const char *luaL_optstring (lua_State *L,
---
> 
const char *luaL_optstring (lua_State *L,
7811c7845
< 
char *luaL_prepbuffer (luaL_Buffer *B);
--- >
char *luaL_prepbuffer (luaL_Buffer *B);
7823c7857 <
char *luaL_prepbuffsize (luaL_Buffer *B, size_t sz);
--- >
char *luaL_prepbuffsize (luaL_Buffer *B, size_t sz);
7839c7873 <
void luaL_pushfail (lua_State *L);
--- >
void luaL_pushfail (lua_State *L);
7850c7884 <
void luaL_pushresult (luaL_Buffer *B);
--- >
void luaL_pushresult (luaL_Buffer *B);
7862c7896 <
void luaL_pushresultsize (luaL_Buffer *B, size_t sz);
--- >
void luaL_pushresultsize (luaL_Buffer *B, size_t sz);
7873c7907 <
int luaL_ref (lua_State *L, int t);
--- >
int luaL_ref (lua_State *L, int t);
7913c7947 <
typedef struct luaL_Reg {
---
> 
typedef struct luaL_Reg {
7932c7966
< 
void luaL_requiref (lua_State *L, const char *modname,
---
> 
void luaL_requiref (lua_State *L, const char *modname,
7956c7990
< 
void luaL_setfuncs (lua_State *L, const luaL_Reg *l, int nup);
--- >
void luaL_setfuncs (lua_State *L, const luaL_Reg *l, int nup);
7983c8017 <
void luaL_setmetatable (lua_State *L, const char *tname);
--- >
void luaL_setmetatable (lua_State *L, const char *tname);
7995c8029 <
void *luaL_alloc (void *ud, void *ptr, size_t osize, size_t nsize);
--- >
void *luaL_alloc (void *ud, void *ptr, size_t osize, size_t nsize);
8006c8040 <
typedef struct luaL_Stream {
---
> 
typedef struct luaL_Stream {
8045c8079
< 
void *luaL_testudata (lua_State *L, int arg, const char *tname);
--- >
void *luaL_testudata (lua_State *L, int arg, const char *tname);
8058c8092 <
const char *luaL_tolstring (lua_State *L, int idx, size_t *len);
--- >
const char *luaL_tolstring (lua_State *L, int idx, size_t *len);
8081c8115 <
void luaL_traceback (lua_State *L, lua_State *L1, const char *msg,
---
> 
void luaL_traceback (lua_State *L, lua_State *L1, const char *msg,
8097c8131
< 
int luaL_typeerror (lua_State *L, int arg, const char *tname);
--- >
int luaL_typeerror (lua_State *L, int arg, const char *tname);
8112c8146 <
const char *luaL_typename (lua_State *L, int index);
--- >
const char *luaL_typename (lua_State *L, int index);
8123c8157 <
void luaL_unref (lua_State *L, int t, int ref);
--- >
void luaL_unref (lua_State *L, int t, int ref);
8143c8177 <
void luaL_where (lua_State *L, int lvl);
--- >
void luaL_where (lua_State *L, int lvl);
8258c8292 <
void luaL_openlibs (lua_State *L);
--- >
void luaL_openlibs (lua_State *L);
8269c8303 <
void luaL_openselectedlibs (lua_State *L, int load, int preload);
--- >
void luaL_openselectedlibs (lua_State *L, int load, int preload);
8657,8658c8691 < See function next for the caveats of modifying < the table during its traversal. --- > See function next for more details about the traversal. 11683a11717,11719 > > >

11692a11729,11730 > It is good practice to always require this library explicitly > before using it. 12308a12347,12351 > > >

> The compilation option LUA_COMPAT_GLOBAL (see luaconf.h) > makes global a regular word. 12438c12481 < global attnamelist | --- > global attnamelist [‘=’ explist] | 12502c12545 < Mon Dec 15 21:02:05 UTC 2025 --- > Fri Jul 24 14:07:32 UTC 2026 12505c12548 < Last change: revised for Lua 5.5.0 --- > Last change: revised for Lua 5.5.1 diff -Nr lua-5.5.0/doc/readme.html lua-5.5.1/doc/readme.html 112c112 < the top-level directory, which is named lua-5.5.0. --- > the top-level directory, which is named lua-5.5.1. 265a266 >

  • named vararg tables 299c300 < Copyright © 1994–2025 Lua.org, PUC-Rio. --- > Copyright © 1994–2026 Lua.org, PUC-Rio. 326c327 < Wed Dec 10 11:37:23 UTC 2025 --- > Mon Jul 13 21:20:24 UTC 2026 329c330 < Last change: revised for Lua 5.5.0 --- > Last change: revised for Lua 5.5.1 diff -Nr lua-5.5.0/src/Makefile lua-5.5.1/src/Makefile 33c33 < PLATS= guess aix bsd c89 freebsd generic ios linux macosx mingw posix solaris --- > PLATS= guess aix bsd c89 freebsd generic ios linux linux-readline macosx mingw posix solaris 125a126,128 > linux-readline: > $(MAKE) $(ALL) SYSCFLAGS="-DLUA_USE_LINUX -DLUA_USE_READLINE" SYSLIBS="-Wl,-E -ldl -lreadline" > 127c130 < $(MAKE) $(ALL) SYSCFLAGS="-DLUA_USE_MACOSX -DLUA_USE_READLINE" SYSLIBS="-lreadline" --- > $(MAKE) $(ALL) SYSCFLAGS="-DLUA_USE_MACOSX" SYSLIBS="-lreadline" diff -Nr lua-5.5.0/src/lapi.c lua-5.5.1/src/lapi.c 190c190 < setnilvalue(s2v(L->top.p++)); /* clear new slots */ --- > setnilvalue2s(L->top.p++); /* clear new slots */ 213c213 < setnilvalue(s2v(level)); --- > setnilvalue2s(level); 369c369 < LUA_API unsigned (lua_numbertocstring) (lua_State *L, int idx, char *buff) { --- > LUA_API unsigned lua_numbertocstring (lua_State *L, int idx, char *buff) { 516c516 < setnilvalue(s2v(L->top.p)); --- > setnilvalue2s(L->top.p); 573c573 < setnilvalue(s2v(L->top.p)); --- > setnilvalue2s(L->top.p); 746c746 < setnilvalue(s2v(L->top.p)); --- > setnilvalue2s(L->top.p); 839c839 < setnilvalue(s2v(L->top.p)); --- > setnilvalue2s(L->top.p); 1124a1125 > luaC_checkGC(L); 1203a1205 > l_mem newdebt; 1207,1208c1209,1214 < n = g->GCdebt; /* force to run one basic step */ < luaE_setdebt(g, g->GCdebt - n); --- > newdebt = 0; /* force to run one basic step */ > else if (g->GCdebt >= n - MAX_LMEM) /* no overflow? */ > newdebt = g->GCdebt - n; > else /* overflow */ > newdebt = -MAX_LMEM; /* set debt to mininum value */ > luaE_setdebt(g, newdebt); 1296d1301 < api_checknelems(L, n); 1297a1303 > api_checkpop(L, n); 1415c1421 < api_checknelems(L, 1); --- > api_checkpop(L, 1); diff -Nr lua-5.5.0/src/lauxlib.c lua-5.5.1/src/lauxlib.c 515a516,529 > /* > ** Get/create metatable (MT) for boxes > */ > static void getBoxMT (lua_State *L) { > const char *BOXMT = "_UBOX*"; /* key for the metatable */ > if (luaL_getmetatable(L, BOXMT) == LUA_TNIL) { /* MT not created yet? */ > luaL_newlibtable(L, boxmt); /* create it */ > luaL_setfuncs(L, boxmt, 0); /* initialize it */ > lua_copy(L, -1, -2); /* change stack from nil,MT to MT,MT */ > lua_setfield(L, LUA_REGISTRYINDEX, BOXMT); /* store MT in the registry */ > } > } > > 520,521c534 < if (luaL_newmetatable(L, "_UBOX*")) /* creating metatable? */ < luaL_setfuncs(L, boxmt, 0); /* set its metamethods */ --- > getBoxMT(L); 877c890 < return luaL_loadbuffer(L, s, strlen(s), s); --- > return luaL_loadbufferx(L, s, strlen(s), s, "t"); diff -Nr lua-5.5.0/src/lauxlib.h lua-5.5.1/src/lauxlib.h 84,85c84,85 < LUALIB_API void *luaL_alloc (void *ud, void *ptr, size_t osize, < size_t nsize); --- > LUALIB_API void *(luaL_alloc) (void *ud, void *ptr, size_t osize, > size_t nsize); 106c106 < LUALIB_API unsigned luaL_makeseed (lua_State *L); --- > LUALIB_API unsigned (luaL_makeseed) (lua_State *L); diff -Nr lua-5.5.0/src/lbaselib.c lua-5.5.1/src/lbaselib.c 343,344c343,345 < const char *mode = luaL_optstring(L, idx, "bt"); < if (strchr(mode, 'B') != NULL) /* Lua code cannot use fixed buffers */ --- > const char *mode = luaL_optstring(L, idx, NULL); > if (mode != NULL && strchr(mode, 'B') != NULL) { > /* Lua code cannot use fixed buffers */ 345a347 > } 367,378c369 < ** reserved slot, above all arguments, to hold a copy of the returned < ** string to avoid it being collected while parsed. 'load' has four < ** optional arguments (chunk, source name, mode, and environment). < */ < #define RESERVEDSLOT 5 < < < /* < ** Reader for generic 'load' function: 'lua_load' uses the < ** stack for internal stuff, so the reader cannot change the < ** stack top. Instead, it keeps its resulting string in a < ** reserved slot inside the stack. --- > ** Reader for generic 'load' function. 381c372 < (void)(ud); /* not used */ --- > int *firstcall = cast(int *, ud); 382a374,377 > if (*firstcall) > *firstcall = 0; > else > lua_pop(L, 1); /* remove previous result */ 386d380 < lua_pop(L, 1); /* pop result */ 392,393c386 < lua_replace(L, RESERVEDSLOT); /* save string in reserved slot */ < return lua_tolstring(L, RESERVEDSLOT, size); --- > return lua_tolstring(L, -1, size); 407a401 > int firstcall = 1; /* userdata for generic_reader */ 410,411c404 < lua_settop(L, RESERVEDSLOT); /* create reserved slot */ < status = lua_load(L, generic_reader, NULL, chunkname, mode); --- > status = lua_load(L, generic_reader, &firstcall, chunkname, mode); 428c421 < if (l_unlikely(luaL_loadfile(L, fname) != LUA_OK)) --- > if (l_unlikely(luaL_loadfilex(L, fname, "bt") != LUA_OK)) diff -Nr lua-5.5.0/src/lcode.c lua-5.5.1/src/lcode.c 666,667c666,667 < TValue k, v; < setnilvalue(&v); --- > lua_State *L = fs->ls->L; > TValue k; 669,670c669,670 < sethvalue(fs->ls->L, &k, fs->kcache); < return k2proto(fs, &k, &v); --- > sethvalue(L, &k, fs->kcache); > return k2proto(fs, &k, &G(L)->nilvalue); 830c830 < e->u.info = temp; /* (can't do a direct assignment; values overlap) */ --- > e->u.info = temp; /* (avoid a direct assignment; values overlap) */ 1368c1368 < t->u.ind.t = temp; /* (can't do a direct assignment; values overlap) */ --- > t->u.ind.t = temp; /* (avoid a direct assignment; values overlap) */ 1376c1376 < t->u.ind.t = vreg; /* (avoid a direct assignment; values may overlap) */ --- > t->u.ind.t = vreg; /* (avoid a direct assignment; values may overlap?) */ 1381c1381,1382 < t->u.ind.t = cast_byte((t->k == VLOCAL) ? t->u.var.ridx: t->u.info); --- > lu_byte temp = cast_byte((t->k == VLOCAL) ? t->u.var.ridx: t->u.info); > t->u.ind.t = temp; /* (avoid a direct assignment; values may overlap?) */ 1936,1937d1936 < /* avoid "not used" warnings when assert is off (for 'onelua.c') */ < (void)luaP_isOT; (void)luaP_isIT; diff -Nr lua-5.5.0/src/ldblib.c lua-5.5.1/src/ldblib.c 430c430 < if (luaL_loadbuffer(L, buffer, strlen(buffer), "=(debug command)") || --- > if (luaL_loadbufferx(L, buffer, strlen(buffer), "=(debug command)", "t") || diff -Nr lua-5.5.0/src/ldebug.c lua-5.5.1/src/ldebug.c 294c294 < setnilvalue(s2v(L->top.p)); --- > setnilvalue2s(L->top.p); 583c583 < case OP_GETTABLE: { --- > case OP_GETTABLE: case OP_GETVARG: { diff -Nr lua-5.5.0/src/ldo.c lua-5.5.1/src/ldo.c 224,226c224,226 < ** Check whether stack has enough space to run a simple function (such < ** as a finalizer): At least BASIC_STACK_SIZE in the Lua stack and < ** 2 slots in the C stack. --- > ** Check whether stacks have enough space to run a simple function (such > ** as a finalizer): At least BASIC_STACK_SIZE in the Lua stack, two > ** available CallInfos, and two "slots" in the C stack. 229,230c229,238 < return ((stacksize(L) < MAXSTACK - BASIC_STACK_SIZE) && < (getCcalls(L) < LUAI_MAXCCALLS - 2)); --- > if (getCcalls(L) >= LUAI_MAXCCALLS - 2) > return 0; /* not enough C-stack slots */ > if (L->ci->next == NULL && luaE_extendCI(L, 0) == NULL) > return 0; /* unable to allocate first ci */ > if (L->ci->next->next == NULL && luaE_extendCI(L, 0) == NULL) > return 0; /* unable to allocate second ci */ > if (L->stack_last.p - L->top.p >= BASIC_STACK_SIZE) > return 1; /* enough (BASIC_STACK_SIZE) free slots in the Lua stack */ > else /* try to grow stack to a size with enough free slots */ > return luaD_growstack(L, BASIC_STACK_SIZE, 0); 344c352 < setnilvalue(s2v(newstack + i)); /* erase new segment */ --- > setnilvalue2s(newstack + i); /* erase new segment */ 425,430d432 < < void luaD_inctop (lua_State *L) { < L->top.p++; < luaD_checkstack(L, 1); < } < 549c551 < setnilvalue(s2v(res + i)); --- > setnilvalue2s(res + i); 569c571 < setnilvalue(s2v(res)); /* adjust with nil */ --- > setnilvalue2s(res); /* adjust with nil */ 619c621 < #define next_ci(L) (L->ci->next ? L->ci->next : luaE_extendCI(L)) --- > #define next_ci(L) (L->ci->next ? L->ci->next : luaE_extendCI(L, 1)) 689c691 < setnilvalue(s2v(func + narg1)); /* complete missing arguments */ --- > setnilvalue2s(func + narg1); /* complete missing arguments */ 736c738 < setnilvalue(s2v(L->top.p++)); /* complete missing arguments */ --- > setnilvalue2s(L->top.p++); /* complete missing arguments */ 1122a1125,1128 > /* > ** Before the first call to the reader function, Lua reserves a slot > ** with a table for anchoring stuff. > */ 1127c1133,1139 < int c = zgetc(p->z); /* read first character */ --- > int c; > Table *anchor; > ptrdiff_t otop = savestack(L, L->top.p); /* original top */ > luaD_checkstack(L, 2); > anchor = luaH_new(L); /* create the anchor table */ > sethvalue2s(L, L->top.p++, anchor); /* anchor the anchor table */ > c = zgetc(p->z); /* read first character */ 1134c1146 < cl = luaU_undump(L, p->z, p->name, fixed); --- > cl = luaU_undump(L, p->z, anchor, p->name, fixed); 1138c1150 < cl = luaY_parser(L, p->z, &p->buff, &p->dyd, p->name, c); --- > cl = luaY_parser(L, p->z, anchor, &p->buff, &p->dyd, p->name, c); 1139a1152,1153 > L->top.p = restorestack(L, otop); /* restore stack */ > setclLvalue2s(L, L->top.p++, cl); /* push closure */ 1141a1156,1169 > } > > > /* > ** Anchor an object in a table in the stack. First, anchor the object > ** temporarily in the stack, as luaH_set may call an emergency GC. > ** Then, add it in the table with itself as its key. > */ > void luaD_anchorobj (lua_State *L, Table *anchor, GCObject *obj) { > setgcovalue(L, s2v(L->top.p++), obj); /* temporary anchor in the stack */ > luaH_set(L, anchor, s2v(L->top.p - 1), s2v(L->top.p - 1)); > /* Because this is a new key, luaH_set will call the GC barrier, so > we don't need to call the barrier again here */ > L->top.p--; diff -Nr lua-5.5.0/src/ldo.h lua-5.5.1/src/ldo.h 91d90 < LUAI_FUNC void luaD_inctop (lua_State *L); 92a92 > LUAI_FUNC void luaD_anchorobj (lua_State *L, Table *anchor, GCObject *obj); diff -Nr lua-5.5.0/src/lgc.c lua-5.5.1/src/lgc.c 712c712 < setnilvalue(s2v(o)); /* clear dead stack slice */ --- > setnilvalue2s(o); /* clear dead stack slice */ 1296c1296 < if (!g->gcemergency && luaD_checkminstack(L)) --- > if (g->tobefnz != NULL && !g->gcemergency && luaD_checkminstack(L)) 1675c1675 < else { /* no more finalizers or emergency mode or no enough stack --- > else { /* no more finalizers or emergency mode or not enough stack diff -Nr lua-5.5.0/src/llex.c lua-5.5.1/src/llex.c 191c191 < #if defined(LUA_COMPAT_GLOBAL) --- > #if LUA_COMPAT_GLOBAL diff -Nr lua-5.5.0/src/llimits.h lua-5.5.1/src/llimits.h 237c237 < #define luai_numidiv(L,a,b) ((void)L, l_floor(luai_numdiv(L,a,b))) --- > #define luai_numidiv(L,a,b) l_floor(luai_numdiv(L,a,b)) 242c242 < #define luai_numdiv(L,a,b) ((a)/(b)) --- > #define luai_numdiv(L,a,b) ((void)L, (a)/(b)) 270,273c270,273 < #define luai_numadd(L,a,b) ((a)+(b)) < #define luai_numsub(L,a,b) ((a)-(b)) < #define luai_nummul(L,a,b) ((a)*(b)) < #define luai_numunm(L,a) (-(a)) --- > #define luai_numadd(L,a,b) ((void)L, (a)+(b)) > #define luai_numsub(L,a,b) ((void)L, (a)-(b)) > #define luai_nummul(L,a,b) ((void)L, (a)*(b)) > #define luai_numunm(L,a) ((void)L, -(a)) diff -Nr lua-5.5.0/src/loadlib.c lua-5.5.1/src/loadlib.c 544c544 < return checkload(L, (luaL_loadfile(L, filename) == LUA_OK), filename); --- > return checkload(L, (luaL_loadfilex(L, filename, "bt") == LUA_OK), filename); diff -Nr lua-5.5.0/src/lobject.h lua-5.5.1/src/lobject.h 211c211,212 < #define setnilvalue(obj) settt_(obj, LUA_VNIL) --- > #define setnilvalue(obj) settt_(obj, LUA_VNIL) > #define setnilvalue2s(stk) setnilvalue(s2v(stk)) diff -Nr lua-5.5.0/src/lopcodes.c lua-5.5.1/src/lopcodes.c 107c107 < ,opmode(0, 0, 1, 0, 1, iABC) /* OP_VARARGPREP */ --- > ,opmode(0, 0, 0, 0, 0, iABC) /* OP_VARARGPREP */ 112,124c112 < < /* < ** Check whether instruction sets top for next instruction, that is, < ** it results in multiple values. < */ < int luaP_isOT (Instruction i) { < OpCode op = GET_OPCODE(i); < switch (op) { < case OP_TAILCALL: return 1; < default: < return testOTMode(op) && GETARG_C(i) == 0; < } < } --- > #define testITMode(m) (luaP_opmodes[m] & (1 << 5)) 128,129c116,118 < ** Check whether instruction uses top from previous instruction, that is, < ** it accepts multiple results. --- > ** Check whether instruction uses top. That happens for OP_VARARGPREP > ** and for instructions that use multiple values set by the previous > ** instruction. 135c124,126 < return testITMode(GET_OPCODE(i)) && GETARG_vB(i) == 0; --- > return GETARG_vB(i) == 0; > case OP_VARARGPREP: > return 1; diff -Nr lua-5.5.0/src/lopcodes.h lua-5.5.1/src/lopcodes.h 420,421c420,421 < ** bit 5: instruction uses 'L->top' set by previous instruction (when B == 0) < ** bit 6: instruction sets 'L->top' for next instruction (when C == 0) --- > ** bit 5: used by 'luaP_isIT' > ** bit 6: used by 'luaP_isOT' 430,431d429 < #define testITMode(m) (luaP_opmodes[m] & (1 << 5)) < #define testOTMode(m) (luaP_opmodes[m] & (1 << 6)) 435c433,440 < LUAI_FUNC int luaP_isOT (Instruction i); --- > /* Check whether instruction sets top for next instruction, that is, > ** it results in multiple values. Used only for tests. > */ > #define luaP_isOT(i) \ > (GET_OPCODE(i) == OP_TAILCALL || \ > ((luaP_opmodes[GET_OPCODE(i)] & (1 << 6)) && GETARG_C(i) == 0)) > > diff -Nr lua-5.5.0/src/lparser.c lua-5.5.1/src/lparser.c 824,825c824 < sethvalue2s(L, L->top.p, fs->kcache); /* anchor it */ < luaD_inctop(L); --- > luaD_anchorobj(L, ls->h, obj2gco(fs->kcache)); /* anchor it */ 833a833 > TValue temp; 845a846,848 > /* remove kcache table from scanner table ("weigh" its anchor) */ > sethvalue(L, &temp, fs->kcache); /* key to be set to nil */ > luaH_set(L, ls->h, &temp, &G(L)->nilvalue); 847d849 < L->top.p--; /* pop kcache table */ 1166a1169 > return; /* to avoid warnings */ 1614d1616 < leaveblock(fs); /* finish scope */ 1622a1625 > leaveblock(fs); /* finish scope */ 2114c2117 < #if defined(LUA_COMPAT_GLOBAL) --- > #if LUA_COMPAT_GLOBAL 2168c2171 < LClosure *luaY_parser (lua_State *L, ZIO *z, Mbuffer *buff, --- > LClosure *luaY_parser (lua_State *L, ZIO *z, Table *anchor, Mbuffer *buff, 2172,2177c2175,2178 < LClosure *cl = luaF_newLclosure(L, 1); /* create main closure */ < setclLvalue2s(L, L->top.p, cl); /* anchor it (to avoid being collected) */ < luaD_inctop(L); < lexstate.h = luaH_new(L); /* create table for scanner */ < sethvalue2s(L, L->top.p, lexstate.h); /* anchor it */ < luaD_inctop(L); --- > LClosure *cl; > lexstate.h = anchor; /* table for scanner */ > cl = luaF_newLclosure(L, 1); /* create main closure */ > luaD_anchorobj(L, anchor, obj2gco(cl)); /* anchor it in scanner table */ 2190,2191c2191 < L->top.p--; /* remove scanner's table */ < return cl; /* closure is on the stack, too */ --- > return cl; diff -Nr lua-5.5.0/src/lparser.h lua-5.5.1/src/lparser.h 192,193c192,194 < LUAI_FUNC LClosure *luaY_parser (lua_State *L, ZIO *z, Mbuffer *buff, < Dyndata *dyd, const char *name, int firstchar); --- > LUAI_FUNC LClosure *luaY_parser (lua_State *L, ZIO *z, Table *anchor, > Mbuffer *buff, Dyndata *dyd, > const char *name, int firstchar); diff -Nr lua-5.5.0/src/lstate.c lua-5.5.1/src/lstate.c 71c71 < CallInfo *luaE_extendCI (lua_State *L) { --- > CallInfo *luaE_extendCI (lua_State *L, int err) { 73,76c73,79 < lua_assert(L->ci->next == NULL); < ci = luaM_new(L, CallInfo); < lua_assert(L->ci->next == NULL); < L->ci->next = ci; --- > ci = luaM_reallocvector(L, NULL, 0, 1, CallInfo); > if (l_unlikely(ci == NULL)) { /* allocation failed? */ > if (err) > luaM_error(L); /* raise the error */ > return NULL; /* else only report it */ > } > ci->next = L->ci->next; 78c81,83 < ci->next = NULL; --- > L->ci->next = ci; > if (ci->next) > ci->next->previous = ci; 149c154 < setnilvalue(s2v(ci->func.p)); /* 'function' entry for basic 'ci' */ --- > setnilvalue2s(ci->func.p); /* 'function' entry for basic 'ci' */ 164c169 < setnilvalue(s2v(L1->stack.p + i)); /* erase new stack */ --- > setnilvalue2s(L1->stack.p + i); /* erase new stack */ diff -Nr lua-5.5.0/src/lstate.h lua-5.5.1/src/lstate.h 386c386 < ** Union of all collectable objects (only for conversions) --- > ** Union of all collectable objects 406,409c406,412 < /* < ** ISO C99, 6.7.2.1 p.14: < ** "A pointer to a union object, suitably converted, points to each of < ** its members [...], and vice versa." --- > /* macros to convert a GCObject into a specific value > ** ISO C99, 6.3.2.2 p.7: > ** "A pointer to an object or incomplete type may be converted to a > ** pointer to a different object or incomplete type. If the resulting > ** pointer is not correctly aligned for the pointed-to type, the > ** behavior is undefined. Otherwise, when converted back again, the > ** result shall compare equal to the original pointer." 411,424c414,424 < #define cast_u(o) cast(union GCUnion *, (o)) < < /* macros to convert a GCObject into a specific value */ < #define gco2ts(o) \ < check_exp(novariant((o)->tt) == LUA_TSTRING, &((cast_u(o))->ts)) < #define gco2u(o) check_exp((o)->tt == LUA_VUSERDATA, &((cast_u(o))->u)) < #define gco2lcl(o) check_exp((o)->tt == LUA_VLCL, &((cast_u(o))->cl.l)) < #define gco2ccl(o) check_exp((o)->tt == LUA_VCCL, &((cast_u(o))->cl.c)) < #define gco2cl(o) \ < check_exp(novariant((o)->tt) == LUA_TFUNCTION, &((cast_u(o))->cl)) < #define gco2t(o) check_exp((o)->tt == LUA_VTABLE, &((cast_u(o))->h)) < #define gco2p(o) check_exp((o)->tt == LUA_VPROTO, &((cast_u(o))->p)) < #define gco2th(o) check_exp((o)->tt == LUA_VTHREAD, &((cast_u(o))->th)) < #define gco2upv(o) check_exp((o)->tt == LUA_VUPVAL, &((cast_u(o))->upv)) --- > #define gco2(v,T,o) check_exp((o)->tt == v, cast(T*, o)) > #define gco2nv(t,T,o) check_exp(novariant((o)->tt) == t, cast(T*, o)) > #define gco2ts(o) gco2nv(LUA_TSTRING, TString, o) > #define gco2u(o) gco2(LUA_VUSERDATA, Udata, o) > #define gco2lcl(o) (&gco2(LUA_VLCL, Closure, o)->l) > #define gco2ccl(o) (&gco2(LUA_VCCL, Closure, o)->c) > #define gco2cl(o) gco2nv(LUA_TFUNCTION, Closure, o) > #define gco2t(o) gco2(LUA_VTABLE, Table, o) > #define gco2p(o) gco2(LUA_VPROTO, Proto, o) > #define gco2th(o) gco2(LUA_VTHREAD, lua_State, o) > #define gco2upv(o) gco2(LUA_VUPVAL, UpVal, o) 431c431 < check_exp(novariant((v)->tt) >= LUA_TSTRING, &(cast_u(v)->gc)) --- > check_exp(novariant((v)->tt) >= LUA_TSTRING, cast(GCObject*, v)) 441c441 < LUAI_FUNC CallInfo *luaE_extendCI (lua_State *L); --- > LUAI_FUNC CallInfo *luaE_extendCI (lua_State *L, int err); diff -Nr lua-5.5.0/src/lstrlib.c lua-5.5.1/src/lstrlib.c 144,145c144,145 < if (n <= 0) < lua_pushliteral(L, ""); --- > if (n <= 0 || (len | lsep) == 0) > lua_pushliteral(L, ""); /* no repetitions or both strings empty */ 759a760,762 > /* > ** Prepare state for matches. These fields are not affected by each match. > */ 763d765 < ms->matchdepth = MAXCCALLS; 769a772,775 > /* > ** (Re)prepare state for a match, setting fields that change during > ** each match. > */ 770a777 > ms->matchdepth = MAXCCALLS; 772d778 < lua_assert(ms->matchdepth == MAXCCALLS); 971c977 < changed = add_value(&ms, &b, src, e, tr) | changed; --- > changed = add_value(&ms, &b, src, e, tr) || changed; 1729c1735 < luaL_argcheck(L, totalsize <= LUA_MAXINTEGER - size, --- > luaL_argcheck(L, totalsize <= MAX_SIZE - size, diff -Nr lua-5.5.0/src/ltable.c lua-5.5.1/src/ltable.c 654,657c654,656 < ** Exchange the hash part of 't1' and 't2'. (In 'flags', only the < ** dummy bit must be exchanged: The 'isrealasize' is not related < ** to the hash part, and the metamethod bits do not change during < ** a resize, so the "real" table can keep their values.) --- > ** Exchange the hash part of 't1' and 't2'. (In 'flags', only the dummy > ** bit must be exchanged: The metamethod bits do not change during a > ** resize, so the "real" table can keep their values.) 1158a1158 > const TValue *actk = key; /* actual key to insert */ 1164,1166c1164,1166 < if (luaV_flttointeger(f, &k, F2Ieq)) { < setivalue(&aux, k); /* key is equal to an integer */ < key = &aux; /* insert it as an integer */ --- > if (luaV_flttointeger(f, &k, F2Ieq)) { /* is key equal to an integer? */ > setivalue(&aux, k); > actk = &aux; /* use the integer as the key */ 1179c1179 < luaH_newkey(L, t, key, value); --- > luaH_newkey(L, t, actk, value); diff -Nr lua-5.5.0/src/ltablib.c lua-5.5.1/src/ltablib.c 45c45 < ** has a metatable with the required metamethods) --- > ** has a metatable with the required metamethods). 48c48,49 < if (lua_type(L, arg) != LUA_TTABLE) { /* is it not a table? */ --- > int tp = lua_type(L, arg); > if (tp != LUA_TTABLE) { /* is it not a table? */ 53c54,55 < (!(what & TAB_L) || checkfield(L, "__len", ++n))) { --- > (!(what & TAB_L) || /* strings don't need '__len' to have a length */ > tp == LUA_TSTRING || checkfield(L, "__len", ++n))) { 206a209 > lua_Integer len = aux_getn(L, 1, TAB_R); 208c211 < lua_Integer e = luaL_opt(L, luaL_checkinteger, 3, luaL_len(L, 1)); --- > lua_Integer e = luaL_opt(L, luaL_checkinteger, 3, len); diff -Nr lua-5.5.0/src/ltm.c lua-5.5.1/src/ltm.c 265c265 < setnilvalue(s2v(ci->func.p + i)); /* erase original parameter (for GC) */ --- > setnilvalue2s(ci->func.p + i); /* erase original parameter (for GC) */ 286c286 < setnilvalue(s2v(ci->func.p + nfixparams + 1)); --- > setnilvalue2s(ci->func.p + nfixparams + 1); 310c310 < setnilvalue(s2v(ra)); /* else produce nil */ --- > setnilvalue2s(ra); /* else produce nil */ 358c358 < setnilvalue(s2v(where + i)); --- > setnilvalue2s(where + i); 362c362 < setnilvalue(s2v(where + i)); --- > setnilvalue2s(where + i); diff -Nr lua-5.5.0/src/ltm.h lua-5.5.1/src/ltm.h 52c52 < ** the table is using the dummy node; bit 7 is used for 'isrealasize'.) --- > ** the table is using the dummy node.) diff -Nr lua-5.5.0/src/lua.c lua-5.5.1/src/lua.c 32a33,38 > /* Name of the environment variable with the name of the readline library */ > #if !defined(LUA_RLLIB_VAR) > #define LUA_RLLIB_VAR "LUA_READLINELIB" > #endif > > 204c210 < return dochunk(L, luaL_loadfile(L, name)); --- > return dochunk(L, luaL_loadfilex(L, name, "bt")); 209c215 < return dochunk(L, luaL_loadbuffer(L, s, strlen(s), name)); --- > return dochunk(L, luaL_loadbufferx(L, s, strlen(s), name, "t")); 263c269 < status = luaL_loadfile(L, fname); --- > status = luaL_loadfilex(L, fname, "bt"); 376a383,391 > static char *(*l_getenv)(const char *name); > > /* Function to ignore environment variables, used by option -E */ > static char *no_getenv (const char *name) { > UNUSED(name); > return NULL; > } > > 379c394 < const char *init = getenv(name + 1); --- > const char *init = l_getenv(name + 1); 382c397 < init = getenv(name + 1); /* try alternative name */ --- > init = l_getenv(name + 1); /* try alternative name */ 501,504c516,521 < void *lib = dlopen(LUA_READLINELIB, RTLD_NOW | RTLD_LOCAL); < if (lib == NULL) < lua_warning(L, "library '" LUA_READLINELIB "' not found", 0); < else { --- > const char *rllib = l_getenv(LUA_RLLIB_VAR); /* name of readline library */ > void *lib; /* library handle */ > if (rllib == NULL) /* no environment variable? */ > rllib = LUA_READLINELIB; /* use default name */ > lib = dlopen(rllib, RTLD_NOW | RTLD_LOCAL); > if (lib != NULL) { 510,512c527,533 < if (l_readline == NULL) < lua_warning(L, "unable to load 'readline'", 0); < } --- > if (l_readline != NULL) /* could load readline function? */ > return; /* everything ok */ > /* else emit a warning */ > } > lua_warning(L, "unable to load readline library '", 1); > lua_warning(L, rllib, 1); > lua_warning(L, "'", 0); 591c612 < int status = luaL_loadbuffer(L, retline, strlen(retline), "=stdin"); --- > int status = luaL_loadbufferx(L, retline, strlen(retline), "=stdin", "t"); 595c616 < lua_pop(L, 2); /* pop result from 'luaL_loadbuffer' and modified line */ --- > lua_pop(L, 2); /* pop result from 'luaL_loadbufferx' and modified line */ 622c643 < int status = luaL_loadbuffer(L, line, len, "=stdin"); /* try it */ --- > int status = luaL_loadbufferx(L, line, len, "=stdin", "t"); /* try it */ 696c717,723 < #define luai_openlibs(L) luaL_openselectedlibs(L, ~0, 0) --- > #if defined(LUA_NODEBUGLIB) > /* With this option, code must require the debug library before using it */ > #define luai_openlibs(L) luaL_openselectedlibs(L, ~LUA_DBLIBK, LUA_DBLIBK) > #else > /* The default is to open all standard libraries */ > #define luai_openlibs(L) luaL_openselectedlibs(L, ~0, 0) > #endif 717a745 > l_getenv = &no_getenv; /* program will ignore environment variables */ 720a749,750 > else > l_getenv = &getenv; 725,728c755,756 < if (!(args & has_E)) { /* no option '-E'? */ < if (handle_luainit(L) != LUA_OK) /* run LUA_INIT */ < return 0; /* error running LUA_INIT */ < } --- > if (handle_luainit(L) != LUA_OK) /* run LUA_INIT */ > return 0; /* error running LUA_INIT */ diff -Nr lua-5.5.0/src/lua.h lua-5.5.1/src/lua.h 16c16 < #define LUA_COPYRIGHT LUA_RELEASE " Copyright (C) 1994-2025 Lua.org, PUC-Rio" --- > #define LUA_COPYRIGHT LUA_RELEASE " Copyright (C) 1994-2026 Lua.org, PUC-Rio" 22c22 < #define LUA_VERSION_RELEASE_N 0 --- > #define LUA_VERSION_RELEASE_N 1 524c524 < * Copyright (C) 1994-2025 Lua.org, PUC-Rio. --- > * Copyright (C) 1994-2026 Lua.org, PUC-Rio. diff -Nr lua-5.5.0/src/luaconf.h lua-5.5.1/src/luaconf.h 72a73 > #if !defined(LUA_READLINELIB) 74a76 > #endif 80c82 < #define LUA_READLINELIB "libedit.dylib" --- > #define LUA_USE_READLINE /* needs an extra library: -lreadline */ 227,229c229,231 < LUA_LDIR"?.lua;" LUA_LDIR"?\\init.lua;" \ < LUA_CDIR"?.lua;" LUA_CDIR"?\\init.lua;" \ < LUA_SHRDIR"?.lua;" LUA_SHRDIR"?\\init.lua;" \ --- > LUA_LDIR "?.lua;" LUA_LDIR "?\\init.lua;" \ > LUA_CDIR "?.lua;" LUA_CDIR "?\\init.lua;" \ > LUA_SHRDIR "?.lua;" LUA_SHRDIR "?\\init.lua;" \ 235,237c237,239 < LUA_CDIR"?.dll;" \ < LUA_CDIR"..\\lib\\lua\\" LUA_VDIR "\\?.dll;" \ < LUA_CDIR"loadall.dll;" ".\\?.dll" --- > LUA_CDIR "?.dll;" \ > LUA_CDIR "..\\lib\\lua\\" LUA_VDIR "\\?.dll;" \ > LUA_CDIR "loadall.dll;" ".\\?.dll" 248,249c250,251 < LUA_LDIR"?.lua;" LUA_LDIR"?/init.lua;" \ < LUA_CDIR"?.lua;" LUA_CDIR"?/init.lua;" \ --- > LUA_LDIR "?.lua;" LUA_LDIR "?/init.lua;" \ > LUA_CDIR "?.lua;" LUA_CDIR "?/init.lua;" \ 255c257 < LUA_CDIR"?.so;" LUA_CDIR"loadall.so;" "./?.so" --- > LUA_CDIR "?.so;" LUA_CDIR "loadall.so;" "./?.so" 342c344,346 < #define LUA_COMPAT_GLOBAL --- > #if !defined(LUA_COMPAT_GLOBAL) > #define LUA_COMPAT_GLOBAL 1 > #endif 652c656 < #if defined(__GNUC__) && !defined(LUA_NOBUILTIN) --- > #if !defined(LUA_NOBUILTIN) && defined(__GNUC__) && (__GNUC__ >= 3) 724,725c728,730 < @@ LUAI_MAXALIGN defines fields that, when used in a union, ensure < ** maximum alignment for the other items in that union. --- > @@ LUAI_MAXALIGN defines fields that ensure proper alignment for > ** memory areas offered by Lua (e.g., userdata memory). > ** Add fields to it if you need alignment for non-ISO objects. 726a732,736 > #if defined(LLONG_MAX) > /* use ISO C99 stuff */ > #define LUAI_MAXALIGN long double u; void *s; long long l > #else > /* use only C89 stuff */ 727a738 > #endif diff -Nr lua-5.5.0/src/lundump.c lua-5.5.1/src/lundump.c 395c395,396 < LClosure *luaU_undump (lua_State *L, ZIO *Z, const char *name, int fixed) { --- > LClosure *luaU_undump (lua_State *L, ZIO *Z, Table *anchor, const char *name, > int fixed) { 408,411c409 < cl = luaF_newLclosure(L, loadByte(&S)); < setclLvalue2s(L, L->top.p, cl); < luaD_inctop(L); < S.h = luaH_new(L); /* create list of saved strings */ --- > S.h = anchor; 413,414c411,412 < sethvalue2s(L, L->top.p, S.h); /* anchor it */ < luaD_inctop(L); --- > cl = luaF_newLclosure(L, loadByte(&S)); > luaD_anchorobj(L, anchor, obj2gco(cl)); 421d418 < L->top.p--; /* pop table */ diff -Nr lua-5.5.0/src/lundump.h lua-5.5.1/src/lundump.h 33,34c33,34 < LUAI_FUNC LClosure* luaU_undump (lua_State* L, ZIO* Z, const char* name, < int fixed); --- > LUAI_FUNC LClosure* luaU_undump (lua_State* L, ZIO* Z, Table *anchor, > const char* name, int fixed); diff -Nr lua-5.5.0/src/lutf8lib.c lua-5.5.1/src/lutf8lib.c 58a59,60 > else if (c >= 0xfe) /* c >= 1111 1110b ? */ > return NULL; /* would need six or more continuation bytes */ 66a69 > lua_assert(count <= 5); 68c71 < if (count > 5 || res > MAXUTF || res < limits[count]) --- > if (res > MAXUTF || res < limits[count]) 149c152 < lua_pushfstring(L, "%U", (long)code); --- > lua_pushfstring(L, "%U", cast(unsigned long, code)); diff -Nr lua-5.5.0/src/lvm.c lua-5.5.1/src/lvm.c 271c271 < ** written online with opcode OP_FORLOOP, for performance.) --- > ** written inline with opcode OP_FORLOOP, for performance.) 273c273 < static int floatforloop (StkId ra) { --- > static int floatforloop (lua_State *L, StkId ra) { 306c306 < setnilvalue(s2v(val)); /* result is nil */ --- > setnilvalue2s(val); /* result is nil */ 363,367c363,373 < t = tm; /* else repeat assignment over 'tm' */ < luaV_fastset(t, key, val, hres, luaH_pset); < if (hres == HOK) { < luaV_finishfastset(L, t, val); < return; /* done */ --- > t = tm; /* else must repeat assignment over 'tm' */ > /* do the equivalent to 'luaV_fastset', but saving 'h' */ > if (!ttistable(t)) > hres = HNOTATABLE; > else { > Table *h = hvalue(t); /* next call can change the value at 't' */ > hres = luaH_pset(h, key, val); > if (hres == HOK) { > luaC_barrierback(L, obj2gco(h), val); /* luaV_finishfastset */ > return; /* done */ > } 369c375 < /* else 'return luaV_finishset(L, t, key, val, slot)' (loop) */ --- > /* else 'return luaV_finishset(L, t, key, val, hres)' (loop) */ 922c928 < ** iterpreter loop (function luaV_execute) and may access directly --- > ** interpreter loop (function luaV_execute) and may access directly 1844c1850 < else if (floatforloop(ra)) /* float loop */ --- > else if (floatforloop(L, ra)) /* float loop */