CVS commit: src/external/mit/lua/dist/src

2023-04-23 Thread Nikita
Module Name:src
Committed By:   nikita
Date:   Sun Apr 23 20:52:39 UTC 2023

Modified Files:
src/external/mit/lua/dist/src: lstrlib.c

Log Message:
lua: fix ftb in lstrlib.c for clang

(error: enumeration values 'Knumber' and 'Kdouble' not handled in switch 
[-Werror,-Wswitch])


To generate a diff of this commit:
cvs rdiff -u -r1.19 -r1.20 src/external/mit/lua/dist/src/lstrlib.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.



CVS commit: src/external/mit/lua/dist/src

2023-04-23 Thread Nikita
Module Name:src
Committed By:   nikita
Date:   Sun Apr 23 20:52:39 UTC 2023

Modified Files:
src/external/mit/lua/dist/src: lstrlib.c

Log Message:
lua: fix ftb in lstrlib.c for clang

(error: enumeration values 'Knumber' and 'Kdouble' not handled in switch 
[-Werror,-Wswitch])


To generate a diff of this commit:
cvs rdiff -u -r1.19 -r1.20 src/external/mit/lua/dist/src/lstrlib.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/external/mit/lua/dist/src/lstrlib.c
diff -u src/external/mit/lua/dist/src/lstrlib.c:1.19 src/external/mit/lua/dist/src/lstrlib.c:1.20
--- src/external/mit/lua/dist/src/lstrlib.c:1.19	Sun Apr 16 20:46:17 2023
+++ src/external/mit/lua/dist/src/lstrlib.c	Sun Apr 23 20:52:39 2023
@@ -1,4 +1,4 @@
-/*	$NetBSD: lstrlib.c,v 1.19 2023/04/16 20:46:17 nikita Exp $	*/
+/*	$NetBSD: lstrlib.c,v 1.20 2023/04/23 20:52:39 nikita Exp $	*/
 
 /*
 ** Id: lstrlib.c 
@@ -1446,9 +1446,9 @@ typedef enum KOption {
   Kuint,	/* unsigned integers */
 #ifndef _KERNEL
   Kfloat,	/* single-precision floating-point numbers */
-#endif /* _KERNEL */
   Knumber,	/* Lua "native" floating-point numbers */
   Kdouble,	/* double-precision floating-point numbers */
+#endif /* _KERNEL */
   Kchar,	/* fixed-length strings */
   Kstring,	/* strings with prefixed length */
   Kzstr,	/* zero-terminated strings */
@@ -1520,8 +1520,8 @@ static KOption getoption (Header *h, con
 case 'T': *size = sizeof(size_t); return Kuint;
 #ifndef _KERNEL
 case 'f': *size = sizeof(float); return Kfloat;
-#endif /* _KERNEL */
 case 'd': *size = sizeof(double); return Kdouble;
+#endif
 #ifndef _KERNEL
 case 'n': *size = sizeof(lua_Number); return Knumber;
 #else /* _KERNEL */



Re: CVS commit: src/external/mit/lua/dist/src

2023-04-23 Thread Alexander Nasonov
Nikita wrote:
> Module Name:  src
> Committed By: nikita
> Date: Mon Apr 17 21:17:58 UTC 2023
> 
> Modified Files:
>   src/external/mit/lua/dist/src: ldump.c lundump.c
> 
> Log Message:
> lua: apply upstream bugfix for "Loading a corrupted binary file can segfault."

Unless it's a security bugfix for a release branch, I don't feel that
all those bugfixes should be applied to -current individually, it's
ok to wait for Lua 5.4.5 release and import it.

Alex


CVS commit: src/external/mit/lua/dist/src

2023-04-22 Thread Nikita
Module Name:src
Committed By:   nikita
Date:   Sat Apr 22 19:41:15 UTC 2023

Modified Files:
src/external/mit/lua/dist/src: lvm.c

Log Message:
lua: formatting in lvm.c


To generate a diff of this commit:
cvs rdiff -u -r1.18 -r1.19 src/external/mit/lua/dist/src/lvm.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.



CVS commit: src/external/mit/lua/dist/src

2023-04-22 Thread Nikita
Module Name:src
Committed By:   nikita
Date:   Sat Apr 22 19:41:15 UTC 2023

Modified Files:
src/external/mit/lua/dist/src: lvm.c

Log Message:
lua: formatting in lvm.c


To generate a diff of this commit:
cvs rdiff -u -r1.18 -r1.19 src/external/mit/lua/dist/src/lvm.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/external/mit/lua/dist/src/lvm.c
diff -u src/external/mit/lua/dist/src/lvm.c:1.18 src/external/mit/lua/dist/src/lvm.c:1.19
--- src/external/mit/lua/dist/src/lvm.c:1.18	Fri Apr 21 17:31:33 2023
+++ src/external/mit/lua/dist/src/lvm.c	Sat Apr 22 19:41:15 2023
@@ -1,4 +1,4 @@
-/*	$NetBSD: lvm.c,v 1.18 2023/04/21 17:31:33 nikita Exp $	*/
+/*	$NetBSD: lvm.c,v 1.19 2023/04/22 19:41:15 nikita Exp $	*/
 
 /*
 ** Id: lvm.c 
@@ -500,8 +500,8 @@ l_sinline int LEfloatint (lua_Number f, 
 /*
 ** Return 'l < r', for numbers.
 */
-#ifndef _KERNEL
 l_sinline int LTnum (const TValue *l, const TValue *r) {
+#ifndef _KERNEL
   lua_assert(ttisnumber(l) && ttisnumber(r));
   if (ttisinteger(l)) {
 lua_Integer li = ivalue(l);
@@ -517,22 +517,19 @@ l_sinline int LTnum (const TValue *l, co
 else  /* 'l' is float and 'r' is int */
   return LTfloatint(lf, ivalue(r));
   }
-}
-#endif /* _KERNEL */
-#ifdef _KERNEL
-l_sinline int LTnum (const TValue *l, const TValue *r) {
+#else
   lua_assert(ttisnumber(l));
   lua_assert(ttisnumber(r));
   return ivalue(l) < ivalue(r);  /* both are integers */
-}
 #endif /* _KERNEL */
+}
 
 
 /*
 ** Return 'l <= r', for numbers.
 */
-#ifndef _KERNEL
 l_sinline int LEnum (const TValue *l, const TValue *r) {
+#ifndef _KERNEL
   lua_assert(ttisnumber(l) && ttisnumber(r));
   if (ttisinteger(l)) {
 lua_Integer li = ivalue(l);
@@ -548,15 +545,12 @@ l_sinline int LEnum (const TValue *l, co
 else  /* 'l' is float and 'r' is int */
   return LEfloatint(lf, ivalue(r));
   }
-}
-#endif /* _KERNEL */
-#ifdef _KERNEL
-l_sinline int LEnum (const TValue *l, const TValue *r) {
+#else
   lua_assert(ttisinteger(l));
   lua_assert(ttisinteger(r));
   return ivalue(l) <= ivalue(r);  /* both are integers */
-}
 #endif /* _KERNEL */
+}
 
 
 /*



CVS commit: src/external/mit/lua/dist/src

2023-04-21 Thread Nikita
Module Name:src
Committed By:   nikita
Date:   Fri Apr 21 17:48:07 UTC 2023

Modified Files:
src/external/mit/lua/dist/src: ldo.h

Log Message:
lua: fix formating diff to upstream in ldo.h


To generate a diff of this commit:
cvs rdiff -u -r1.10 -r1.11 src/external/mit/lua/dist/src/ldo.h

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/external/mit/lua/dist/src/ldo.h
diff -u src/external/mit/lua/dist/src/ldo.h:1.10 src/external/mit/lua/dist/src/ldo.h:1.11
--- src/external/mit/lua/dist/src/ldo.h:1.10	Sun Apr 16 20:46:17 2023
+++ src/external/mit/lua/dist/src/ldo.h	Fri Apr 21 17:48:06 2023
@@ -1,4 +1,4 @@
-/*	$NetBSD: ldo.h,v 1.10 2023/04/16 20:46:17 nikita Exp $	*/
+/*	$NetBSD: ldo.h,v 1.11 2023/04/21 17:48:06 nikita Exp $	*/
 
 /*
 ** Id: ldo.h 
@@ -60,7 +60,8 @@ LUAI_FUNC int luaD_protectedparser (lua_
 LUAI_FUNC void luaD_hook (lua_State *L, int event, int line,
 int fTransfer, int nTransfer);
 LUAI_FUNC void luaD_hookcall (lua_State *L, CallInfo *ci);
-LUAI_FUNC int luaD_pretailcall (lua_State *L, CallInfo *ci, StkId func,int narg1, int delta);
+LUAI_FUNC int luaD_pretailcall (lua_State *L, CallInfo *ci, StkId func,
+  int narg1, int delta);
 LUAI_FUNC CallInfo *luaD_precall (lua_State *L, StkId func, int nResults);
 LUAI_FUNC void luaD_call (lua_State *L, StkId func, int nResults);
 LUAI_FUNC void luaD_callnoyield (lua_State *L, StkId func, int nResults);



CVS commit: src/external/mit/lua/dist/src

2023-04-21 Thread Nikita
Module Name:src
Committed By:   nikita
Date:   Fri Apr 21 17:48:07 UTC 2023

Modified Files:
src/external/mit/lua/dist/src: ldo.h

Log Message:
lua: fix formating diff to upstream in ldo.h


To generate a diff of this commit:
cvs rdiff -u -r1.10 -r1.11 src/external/mit/lua/dist/src/ldo.h

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.



CVS commit: src/external/mit/lua/dist/src

2023-04-21 Thread Nikita
Module Name:src
Committed By:   nikita
Date:   Fri Apr 21 17:31:33 UTC 2023

Modified Files:
src/external/mit/lua/dist/src: lvm.c

Log Message:
lua: fix ftb in lvm.c


To generate a diff of this commit:
cvs rdiff -u -r1.17 -r1.18 src/external/mit/lua/dist/src/lvm.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/external/mit/lua/dist/src/lvm.c
diff -u src/external/mit/lua/dist/src/lvm.c:1.17 src/external/mit/lua/dist/src/lvm.c:1.18
--- src/external/mit/lua/dist/src/lvm.c:1.17	Mon Apr 17 20:37:43 2023
+++ src/external/mit/lua/dist/src/lvm.c	Fri Apr 21 17:31:33 2023
@@ -1,4 +1,4 @@
-/*	$NetBSD: lvm.c,v 1.17 2023/04/17 20:37:43 nikita Exp $	*/
+/*	$NetBSD: lvm.c,v 1.18 2023/04/21 17:31:33 nikita Exp $	*/
 
 /*
 ** Id: lvm.c 
@@ -500,18 +500,16 @@ l_sinline int LEfloatint (lua_Number f, 
 /*
 ** Return 'l < r', for numbers.
 */
+#ifndef _KERNEL
 l_sinline int LTnum (const TValue *l, const TValue *r) {
   lua_assert(ttisnumber(l) && ttisnumber(r));
   if (ttisinteger(l)) {
 lua_Integer li = ivalue(l);
 if (ttisinteger(r))
   return li < ivalue(r);  /* both are integers */
-#ifndef _KERNEL
 else  /* 'l' is int and 'r' is float */
   return LTintfloat(li, fltvalue(r));  /* l < r ? */
-#endif /* _KERNEL */
   }
-#ifndef _KERNEL
   else {
 lua_Number lf = fltvalue(l);  /* 'l' must be float */
 if (ttisfloat(r))
@@ -519,25 +517,30 @@ l_sinline int LTnum (const TValue *l, co
 else  /* 'l' is float and 'r' is int */
   return LTfloatint(lf, ivalue(r));
   }
+}
 #endif /* _KERNEL */
+#ifdef _KERNEL
+l_sinline int LTnum (const TValue *l, const TValue *r) {
+  lua_assert(ttisnumber(l));
+  lua_assert(ttisnumber(r));
+  return ivalue(l) < ivalue(r);  /* both are integers */
 }
+#endif /* _KERNEL */
 
 
 /*
 ** Return 'l <= r', for numbers.
 */
+#ifndef _KERNEL
 l_sinline int LEnum (const TValue *l, const TValue *r) {
   lua_assert(ttisnumber(l) && ttisnumber(r));
   if (ttisinteger(l)) {
 lua_Integer li = ivalue(l);
 if (ttisinteger(r))
   return li <= ivalue(r);  /* both are integers */
-#ifndef _KERNEL
 else  /* 'l' is int and 'r' is float */
   return LEintfloat(li, fltvalue(r));  /* l <= r ? */
-#endif /* _KERNEL */
   }
-#ifndef _KERNEL
   else {
 lua_Number lf = fltvalue(l);  /* 'l' must be float */
 if (ttisfloat(r))
@@ -545,8 +548,15 @@ l_sinline int LEnum (const TValue *l, co
 else  /* 'l' is float and 'r' is int */
   return LEfloatint(lf, ivalue(r));
   }
+}
 #endif /* _KERNEL */
+#ifdef _KERNEL
+l_sinline int LEnum (const TValue *l, const TValue *r) {
+  lua_assert(ttisinteger(l));
+  lua_assert(ttisinteger(r));
+  return ivalue(l) <= ivalue(r);  /* both are integers */
 }
+#endif /* _KERNEL */
 
 
 /*



CVS commit: src/external/mit/lua/dist/src

2023-04-21 Thread Nikita
Module Name:src
Committed By:   nikita
Date:   Fri Apr 21 17:31:33 UTC 2023

Modified Files:
src/external/mit/lua/dist/src: lvm.c

Log Message:
lua: fix ftb in lvm.c


To generate a diff of this commit:
cvs rdiff -u -r1.17 -r1.18 src/external/mit/lua/dist/src/lvm.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.



Re: CVS commit: src/external/mit/lua/dist/src

2023-04-18 Thread Rin Okuyama

Thanks!

rin

On 2023/04/18 22:53, Nikita Ronja Gillmann wrote:

Hi,

okay. I'll add them for now as notes in one of the README files in the lua 
directory.

Rin Okuyama transcribed 0.4K bytes:

Hello again,

On 2023/04/18 4:16, Nikita wrote:

Module Name:    src
Committed By:    nikita
Date:    Mon Apr 17 19:16:38 UTC 2023

Modified Files:
src/external/mit/lua/dist/src: lua.c

Log Message:
lua: Apply upstream bugfix for "lua.c assumes that argv has at least one 
element."


Upstream commit number, and URL for the commit on web interface of VCS must be
very helpful for us.

Thanks,
rin


CVS commit: src/external/mit/lua/dist

2023-04-18 Thread Nikita
Module Name:src
Committed By:   nikita
Date:   Tue Apr 18 14:07:04 UTC 2023

Modified Files:
src/external/mit/lua/dist: README.import

Log Message:
lua: mention patches with commit IDs in README.import for now.


To generate a diff of this commit:
cvs rdiff -u -r1.3 -r1.4 src/external/mit/lua/dist/README.import

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.



CVS commit: src/external/mit/lua/dist

2023-04-18 Thread Nikita
Module Name:src
Committed By:   nikita
Date:   Tue Apr 18 14:07:04 UTC 2023

Modified Files:
src/external/mit/lua/dist: README.import

Log Message:
lua: mention patches with commit IDs in README.import for now.


To generate a diff of this commit:
cvs rdiff -u -r1.3 -r1.4 src/external/mit/lua/dist/README.import

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/external/mit/lua/dist/README.import
diff -u src/external/mit/lua/dist/README.import:1.3 src/external/mit/lua/dist/README.import:1.4
--- src/external/mit/lua/dist/README.import:1.3	Sun Apr 16 20:46:17 2023
+++ src/external/mit/lua/dist/README.import	Tue Apr 18 14:07:03 2023
@@ -18,3 +18,16 @@ Vendor branches are usually named LUA_<<
 with cvs import, they can be named differently.
 
 The last imported vendor branch is called LUA_5_4_4_try2.
+
+This is Lua version 5.4.4 with these patches applied:
+https://github.com/lua/lua/commit/25b143dd34fb587d1e35290c4b25bc08954800e2
+https://github.com/lua/lua/commit/1f3c6f4534c6411313361697d98d1145a1f030fa
+https://github.com/lua/lua/commit/c764ca71a639f5585b5f466bea25dc42b855a4b0
+https://github.com/lua/lua/commit/42d40581dd919fb134c07027ca1ce0844c670daf
+https://github.com/lua/lua/commit/196bb94d66e727e0aec053a0276c3ad701500762
+https://github.com/lua/lua/commit/997f11f54322883c3181225f29d101a597f31730
+https://github.com/lua/lua/commit/a1f77a234a053da46b06d5d4be00ffb30d3eb45b
+https://github.com/lua/lua/commit/a1089b415a3f5c753aa1b40758ffdaf28d5701b0
+https://github.com/lua/lua/commit/1e64c1391f9a14115b5cc82066dbf545ae73ee27
+https://github.com/lua/lua/commit/02bab9fc258fe1cbc6088b1bd61193499d058eff
+https://github.com/lua/lua/commit/ab859fe59b464a038a45552921cb2b23892343af



Re: CVS commit: src/external/mit/lua/dist/src

2023-04-18 Thread Nikita Ronja Gillmann

Hi,

okay. I'll add them for now as notes in one of the README files in the 
lua directory.


Rin Okuyama transcribed 0.4K bytes:

Hello again,

On 2023/04/18 4:16, Nikita wrote:

Module Name:src
Committed By:   nikita
Date:   Mon Apr 17 19:16:38 UTC 2023

Modified Files:
src/external/mit/lua/dist/src: lua.c

Log Message:
lua: Apply upstream bugfix for "lua.c assumes that argv has at least one 
element."


Upstream commit number, and URL for the commit on web interface of VCS must be
very helpful for us.

Thanks,
rin


Re: CVS commit: src/external/mit/lua/dist/src

2023-04-18 Thread Rin Okuyama

Hello again,

On 2023/04/18 4:16, Nikita wrote:

Module Name:src
Committed By:   nikita
Date:   Mon Apr 17 19:16:38 UTC 2023

Modified Files:
src/external/mit/lua/dist/src: lua.c

Log Message:
lua: Apply upstream bugfix for "lua.c assumes that argv has at least one 
element."


Upstream commit number, and URL for the commit on web interface of VCS must be
very helpful for us.

Thanks,
rin


CVS commit: src/external/mit/lua/dist/src

2023-04-17 Thread Nikita
Module Name:src
Committed By:   nikita
Date:   Mon Apr 17 21:17:58 UTC 2023

Modified Files:
src/external/mit/lua/dist/src: ldump.c lundump.c

Log Message:
lua: apply upstream bugfix for "Loading a corrupted binary file can segfault."


To generate a diff of this commit:
cvs rdiff -u -r1.10 -r1.11 src/external/mit/lua/dist/src/ldump.c
cvs rdiff -u -r1.9 -r1.10 src/external/mit/lua/dist/src/lundump.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/external/mit/lua/dist/src/ldump.c
diff -u src/external/mit/lua/dist/src/ldump.c:1.10 src/external/mit/lua/dist/src/ldump.c:1.11
--- src/external/mit/lua/dist/src/ldump.c:1.10	Sun Apr 16 20:46:17 2023
+++ src/external/mit/lua/dist/src/ldump.c	Mon Apr 17 21:17:57 2023
@@ -1,4 +1,4 @@
-/*	$NetBSD: ldump.c,v 1.10 2023/04/16 20:46:17 nikita Exp $	*/
+/*	$NetBSD: ldump.c,v 1.11 2023/04/17 21:17:57 nikita Exp $	*/
 
 /*
 ** Id: ldump.c 
@@ -14,6 +14,7 @@
 
 #ifndef _KERNEL
 #include 
+#include 
 #endif /* _KERNEL */
 
 #include "lua.h"
@@ -59,8 +60,17 @@ static void dumpByte (DumpState *D, int 
 }
 
 
+#ifdef _KERNEL
 /* dumpInt Buff Size */
 #define DIBS((sizeof(size_t) * 8 / 7) + 1)
+#endif /* _KERNEL */
+#ifndef _KERNEL
+/*
+** 'dumpSize' buffer size: each byte can store up to 7 bits. (The "+6"
+** rounds up the division.)
+*/
+#define DIBS((sizeof(size_t) * CHAR_BIT + 6) / 7)
+#endif /* _KERNEL */
 
 static void dumpSize (DumpState *D, size_t x) {
   lu_byte buff[DIBS];

Index: src/external/mit/lua/dist/src/lundump.c
diff -u src/external/mit/lua/dist/src/lundump.c:1.9 src/external/mit/lua/dist/src/lundump.c:1.10
--- src/external/mit/lua/dist/src/lundump.c:1.9	Sun Apr 16 20:46:17 2023
+++ src/external/mit/lua/dist/src/lundump.c	Mon Apr 17 21:17:57 2023
@@ -1,4 +1,4 @@
-/*	$NetBSD: lundump.c,v 1.9 2023/04/16 20:46:17 nikita Exp $	*/
+/*	$NetBSD: lundump.c,v 1.10 2023/04/17 21:17:57 nikita Exp $	*/
 
 /*
 ** Id: lundump.c 
@@ -254,6 +254,8 @@ static void loadDebug (LoadState *S, Pro
 f->locvars[i].endpc = loadInt(S);
   }
   n = loadInt(S);
+  if (n != 0)  /* does it have debug information? */
+n = f->sizeupvalues;  /* must be this many */
   for (i = 0; i < n; i++)
 f->upvalues[i].name = loadStringN(S, f);
 }



CVS commit: src/external/mit/lua/dist/src

2023-04-17 Thread Nikita
Module Name:src
Committed By:   nikita
Date:   Mon Apr 17 21:17:58 UTC 2023

Modified Files:
src/external/mit/lua/dist/src: ldump.c lundump.c

Log Message:
lua: apply upstream bugfix for "Loading a corrupted binary file can segfault."


To generate a diff of this commit:
cvs rdiff -u -r1.10 -r1.11 src/external/mit/lua/dist/src/ldump.c
cvs rdiff -u -r1.9 -r1.10 src/external/mit/lua/dist/src/lundump.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.



CVS commit: src/external/mit/lua/dist/src

2023-04-17 Thread Nikita
Module Name:src
Committed By:   nikita
Date:   Mon Apr 17 20:37:43 UTC 2023

Modified Files:
src/external/mit/lua/dist/src: lvm.c

Log Message:
lua: apply upstream bugfix for "Wrong line in error message for arithmetic 
errors."

It also causes 'L->top' to be wrong when the error happens,
triggering an 'assert'.


To generate a diff of this commit:
cvs rdiff -u -r1.16 -r1.17 src/external/mit/lua/dist/src/lvm.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/external/mit/lua/dist/src/lvm.c
diff -u src/external/mit/lua/dist/src/lvm.c:1.16 src/external/mit/lua/dist/src/lvm.c:1.17
--- src/external/mit/lua/dist/src/lvm.c:1.16	Mon Apr 17 19:35:36 2023
+++ src/external/mit/lua/dist/src/lvm.c	Mon Apr 17 20:37:43 2023
@@ -1,4 +1,4 @@
-/*	$NetBSD: lvm.c,v 1.16 2023/04/17 19:35:36 nikita Exp $	*/
+/*	$NetBSD: lvm.c,v 1.17 2023/04/17 20:37:43 nikita Exp $	*/
 
 /*
 ** Id: lvm.c 
@@ -1467,6 +1467,7 @@ void luaV_execute (lua_State *L, CallInf
 vmbreak;
   }
   vmcase(OP_MODK) {
+savestate(L, ci);  /* in case of division by 0 */
 op_arithK(L, luaV_mod, luaV_modf);
 vmbreak;
   }
@@ -1481,6 +1482,7 @@ void luaV_execute (lua_State *L, CallInf
   }
 #endif /* _KERNEL */
   vmcase(OP_IDIVK) {
+savestate(L, ci);  /* in case of division by 0 */
 op_arithK(L, luaV_idiv, luai_numidiv);
 vmbreak;
   }
@@ -1527,6 +1529,7 @@ void luaV_execute (lua_State *L, CallInf
 vmbreak;
   }
   vmcase(OP_MOD) {
+savestate(L, ci);  /* in case of division by 0 */
 op_arith(L, luaV_mod, luaV_modf);
 vmbreak;
   }
@@ -1541,6 +1544,7 @@ void luaV_execute (lua_State *L, CallInf
   }
 #endif /* _KERNEL */
   vmcase(OP_IDIV) {  /* floor division */
+savestate(L, ci);  /* in case of division by 0 */
 op_arith(L, luaV_idiv, luai_numidiv);
 vmbreak;
   }



CVS commit: src/external/mit/lua/dist/src

2023-04-17 Thread Nikita
Module Name:src
Committed By:   nikita
Date:   Mon Apr 17 20:37:43 UTC 2023

Modified Files:
src/external/mit/lua/dist/src: lvm.c

Log Message:
lua: apply upstream bugfix for "Wrong line in error message for arithmetic 
errors."

It also causes 'L->top' to be wrong when the error happens,
triggering an 'assert'.


To generate a diff of this commit:
cvs rdiff -u -r1.16 -r1.17 src/external/mit/lua/dist/src/lvm.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.



CVS commit: src/external/mit/lua/dist/src

2023-04-17 Thread Nikita
Module Name:src
Committed By:   nikita
Date:   Mon Apr 17 20:33:12 UTC 2023

Modified Files:
src/external/mit/lua/dist/src: lcorolib.c lstate.c lua.h

Log Message:
lua: apply ustream bugfix for "C-stack overflow with deep nesting of 
coroutine.close."


To generate a diff of this commit:
cvs rdiff -u -r1.8 -r1.9 src/external/mit/lua/dist/src/lcorolib.c
cvs rdiff -u -r1.10 -r1.11 src/external/mit/lua/dist/src/lstate.c
cvs rdiff -u -r1.12 -r1.13 src/external/mit/lua/dist/src/lua.h

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/external/mit/lua/dist/src/lcorolib.c
diff -u src/external/mit/lua/dist/src/lcorolib.c:1.8 src/external/mit/lua/dist/src/lcorolib.c:1.9
--- src/external/mit/lua/dist/src/lcorolib.c:1.8	Sun Apr 16 20:46:17 2023
+++ src/external/mit/lua/dist/src/lcorolib.c	Mon Apr 17 20:33:12 2023
@@ -1,4 +1,4 @@
-/*	$NetBSD: lcorolib.c,v 1.8 2023/04/16 20:46:17 nikita Exp $	*/
+/*	$NetBSD: lcorolib.c,v 1.9 2023/04/17 20:33:12 nikita Exp $	*/
 
 /*
 ** Id: lcorolib.c 
@@ -80,7 +80,7 @@ static int luaB_auxwrap (lua_State *L) {
   if (l_unlikely(r < 0)) {  /* error? */
 int stat = lua_status(co);
 if (stat != LUA_OK && stat != LUA_YIELD) {  /* error in the coroutine? */
-  stat = lua_resetthread(co);  /* close its tbc variables */
+  stat = lua_resetthread(co, L);  /* close its tbc variables */
   lua_assert(stat != LUA_OK);
   lua_xmove(co, L, 1);  /* move error message to the caller */
 }
@@ -176,7 +176,7 @@ static int luaB_close (lua_State *L) {
   int status = auxstatus(L, co);
   switch (status) {
 case COS_DEAD: case COS_YIELD: {
-  status = lua_resetthread(co);
+  status = lua_resetthread(co, L);
   if (status == LUA_OK) {
 lua_pushboolean(L, 1);
 return 1;

Index: src/external/mit/lua/dist/src/lstate.c
diff -u src/external/mit/lua/dist/src/lstate.c:1.10 src/external/mit/lua/dist/src/lstate.c:1.11
--- src/external/mit/lua/dist/src/lstate.c:1.10	Sun Apr 16 20:46:17 2023
+++ src/external/mit/lua/dist/src/lstate.c	Mon Apr 17 20:33:12 2023
@@ -1,4 +1,4 @@
-/*	$NetBSD: lstate.c,v 1.10 2023/04/16 20:46:17 nikita Exp $	*/
+/*	$NetBSD: lstate.c,v 1.11 2023/04/17 20:33:12 nikita Exp $	*/
 
 /*
 ** Id: lstate.c 
@@ -347,9 +347,10 @@ int luaE_resetthread (lua_State *L, int 
 }
 
 
-LUA_API int lua_resetthread (lua_State *L) {
+LUA_API int lua_resetthread (lua_State *L, lua_State *from) {
   int status;
   lua_lock(L);
+  L->nCcalls = (from) ? getCcalls(from) : 0;
   status = luaE_resetthread(L, L->status);
   lua_unlock(L);
   return status;

Index: src/external/mit/lua/dist/src/lua.h
diff -u src/external/mit/lua/dist/src/lua.h:1.12 src/external/mit/lua/dist/src/lua.h:1.13
--- src/external/mit/lua/dist/src/lua.h:1.12	Sun Apr 16 20:46:17 2023
+++ src/external/mit/lua/dist/src/lua.h	Mon Apr 17 20:33:12 2023
@@ -1,4 +1,4 @@
-/*	$NetBSD: lua.h,v 1.12 2023/04/16 20:46:17 nikita Exp $	*/
+/*	$NetBSD: lua.h,v 1.13 2023/04/17 20:33:12 nikita Exp $	*/
 
 /*
 ** Id: lua.h 
@@ -157,7 +157,7 @@ extern const char lua_ident[];
 LUA_API lua_State *(lua_newstate) (lua_Alloc f, void *ud);
 LUA_API void   (lua_close) (lua_State *L);
 LUA_API lua_State *(lua_newthread) (lua_State *L);
-LUA_API int(lua_resetthread) (lua_State *L);
+LUA_API int(lua_resetthread) (lua_State *L, lua_State *from);
 
 LUA_API lua_CFunction (lua_atpanic) (lua_State *L, lua_CFunction panicf);
 



CVS commit: src/external/mit/lua/dist/src

2023-04-17 Thread Nikita
Module Name:src
Committed By:   nikita
Date:   Mon Apr 17 20:33:12 UTC 2023

Modified Files:
src/external/mit/lua/dist/src: lcorolib.c lstate.c lua.h

Log Message:
lua: apply ustream bugfix for "C-stack overflow with deep nesting of 
coroutine.close."


To generate a diff of this commit:
cvs rdiff -u -r1.8 -r1.9 src/external/mit/lua/dist/src/lcorolib.c
cvs rdiff -u -r1.10 -r1.11 src/external/mit/lua/dist/src/lstate.c
cvs rdiff -u -r1.12 -r1.13 src/external/mit/lua/dist/src/lua.h

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.



CVS commit: src/external/mit/lua/dist/src

2023-04-17 Thread Nikita
Module Name:src
Committed By:   nikita
Date:   Mon Apr 17 20:27:40 UTC 2023

Modified Files:
src/external/mit/lua/dist/src: lutf8lib.c

Log Message:
lua: apply upstream bugfix for "'utf8.codes' does not raise an error on 
spurious continuation bytes."


To generate a diff of this commit:
cvs rdiff -u -r1.9 -r1.10 src/external/mit/lua/dist/src/lutf8lib.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/external/mit/lua/dist/src/lutf8lib.c
diff -u src/external/mit/lua/dist/src/lutf8lib.c:1.9 src/external/mit/lua/dist/src/lutf8lib.c:1.10
--- src/external/mit/lua/dist/src/lutf8lib.c:1.9	Sun Apr 16 20:46:17 2023
+++ src/external/mit/lua/dist/src/lutf8lib.c	Mon Apr 17 20:27:40 2023
@@ -1,4 +1,4 @@
-/*	$NetBSD: lutf8lib.c,v 1.9 2023/04/16 20:46:17 nikita Exp $	*/
+/*	$NetBSD: lutf8lib.c,v 1.10 2023/04/17 20:27:40 nikita Exp $	*/
 
 /*
 ** Id: lutf8lib.c 
@@ -29,6 +29,8 @@
 
 #define MAXUTF		0x7FFFu
 
+#define MSGInvalid	"invalid UTF-8 code"
+
 /*
 ** Integer type for decoded UTF-8 values; MAXUTF needs 31 bits.
 */
@@ -39,7 +41,8 @@ typedef unsigned long utfint;
 #endif
 
 
-#define iscont(p)	((*(p) & 0xC0) == 0x80)
+#define iscont(c)	(((c) & 0xC0) == 0x80)
+#define iscontp(p)	iscont(*(p))
 
 
 /* from strlib */
@@ -69,7 +72,7 @@ static const char *utf8_decode (const ch
 int count = 0;  /* to count number of continuation bytes */
 for (; c & 0x40; c <<= 1) {  /* while it needs continuation bytes... */
   unsigned int cc = (unsigned char)s[++count];  /* read next byte */
-  if ((cc & 0xC0) != 0x80)  /* not a continuation byte? */
+  if (!iscont(cc))  /* not a continuation byte? */
 return NULL;  /* invalid byte sequence */
   res = (res << 6) | (cc & 0x3F);  /* add lower 6 bits from cont. byte */
 }
@@ -144,7 +147,7 @@ static int codepoint (lua_State *L) {
 utfint code;
 s = utf8_decode(s, , !lax);
 if (s == NULL)
-  return luaL_error(L, "invalid UTF-8 code");
+  return luaL_error(L, MSGInvalid);
 lua_pushinteger(L, code);
 n++;
   }
@@ -194,16 +197,16 @@ static int byteoffset (lua_State *L) {
"position out of bounds");
   if (n == 0) {
 /* find beginning of current byte sequence */
-while (posi > 0 && iscont(s + posi)) posi--;
+while (posi > 0 && iscontp(s + posi)) posi--;
   }
   else {
-if (iscont(s + posi))
+if (iscontp(s + posi))
   return luaL_error(L, "initial position is a continuation byte");
 if (n < 0) {
while (n < 0 && posi > 0) {  /* move back */
  do {  /* find beginning of previous character */
posi--;
- } while (posi > 0 && iscont(s + posi));
+ } while (posi > 0 && iscontp(s + posi));
  n++;
}
  }
@@ -212,7 +215,7 @@ static int byteoffset (lua_State *L) {
while (n > 0 && posi < (lua_Integer)len) {
  do {  /* find beginning of next character */
posi++;
- } while (iscont(s + posi));  /* (cannot pass final '\0') */
+ } while (iscontp(s + posi));  /* (cannot pass final '\0') */
  n--;
}
  }
@@ -230,15 +233,15 @@ static int iter_aux (lua_State *L, int s
   const char *s = luaL_checklstring(L, 1, );
   lua_Unsigned n = (lua_Unsigned)lua_tointeger(L, 2);
   if (n < len) {
-while (iscont(s + n)) n++;  /* skip continuation bytes */
+while (iscontp(s + n)) n++;  /* skip continuation bytes */
   }
   if (n >= len)  /* (also handles original 'n' being negative) */
 return 0;  /* no more codepoints */
   else {
 utfint code;
 const char *next = utf8_decode(s + n, , strict);
-if (next == NULL)
-  return luaL_error(L, "invalid UTF-8 code");
+if (next == NULL || iscontp(next))
+  return luaL_error(L, MSGInvalid);
 lua_pushinteger(L, n + 1);
 lua_pushinteger(L, code);
 return 2;
@@ -257,7 +260,8 @@ static int iter_auxlax (lua_State *L) {
 
 static int iter_codes (lua_State *L) {
   int lax = lua_toboolean(L, 2);
-  luaL_checkstring(L, 1);
+  const char *s = luaL_checkstring(L, 1);
+  luaL_argcheck(L, !iscontp(s), 1, MSGInvalid);
   lua_pushcfunction(L, lax ? iter_auxlax : iter_auxstrict);
   lua_pushvalue(L, 1);
   lua_pushinteger(L, 0);



CVS commit: src/external/mit/lua/dist/src

2023-04-17 Thread Nikita
Module Name:src
Committed By:   nikita
Date:   Mon Apr 17 20:27:40 UTC 2023

Modified Files:
src/external/mit/lua/dist/src: lutf8lib.c

Log Message:
lua: apply upstream bugfix for "'utf8.codes' does not raise an error on 
spurious continuation bytes."


To generate a diff of this commit:
cvs rdiff -u -r1.9 -r1.10 src/external/mit/lua/dist/src/lutf8lib.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.



CVS commit: src/external/mit/lua/dist/src

2023-04-17 Thread Nikita
Module Name:src
Committed By:   nikita
Date:   Mon Apr 17 20:17:58 UTC 2023

Modified Files:
src/external/mit/lua/dist/src: lgc.c

Log Message:
lua: apply upstream bugfix for "GC not setting a proper target for next cycle 
after a full collection in generational mode."


To generate a diff of this commit:
cvs rdiff -u -r1.11 -r1.12 src/external/mit/lua/dist/src/lgc.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.



CVS commit: src/external/mit/lua/dist/src

2023-04-17 Thread Nikita
Module Name:src
Committed By:   nikita
Date:   Mon Apr 17 20:17:58 UTC 2023

Modified Files:
src/external/mit/lua/dist/src: lgc.c

Log Message:
lua: apply upstream bugfix for "GC not setting a proper target for next cycle 
after a full collection in generational mode."


To generate a diff of this commit:
cvs rdiff -u -r1.11 -r1.12 src/external/mit/lua/dist/src/lgc.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/external/mit/lua/dist/src/lgc.c
diff -u src/external/mit/lua/dist/src/lgc.c:1.11 src/external/mit/lua/dist/src/lgc.c:1.12
--- src/external/mit/lua/dist/src/lgc.c:1.11	Sun Apr 16 20:46:17 2023
+++ src/external/mit/lua/dist/src/lgc.c	Mon Apr 17 20:17:58 2023
@@ -1,4 +1,4 @@
-/*	$NetBSD: lgc.c,v 1.11 2023/04/16 20:46:17 nikita Exp $	*/
+/*	$NetBSD: lgc.c,v 1.12 2023/04/17 20:17:58 nikita Exp $	*/
 
 /*
 ** Id: lgc.c 
@@ -1044,7 +1044,25 @@ void luaC_checkfinalizer (lua_State *L, 
 ** ===
 */
 
-static void setpause (global_State *g);
+
+/*
+** Set the "time" to wait before starting a new GC cycle; cycle will
+** start when memory use hits the threshold of ('estimate' * pause /
+** PAUSEADJ). (Division by 'estimate' should be OK: it cannot be zero,
+** because Lua cannot even start with less than PAUSEADJ bytes).
+*/
+static void setpause (global_State *g) {
+  l_mem threshold, debt;
+  int pause = getgcparam(g->gcpause);
+  l_mem estimate = g->GCestimate / PAUSEADJ;  /* adjust 'estimate' */
+  lua_assert(estimate > 0);
+  threshold = (pause < MAX_LMEM / estimate)  /* overflow? */
+? estimate * pause  /* no overflow */
+: MAX_LMEM;  /* overflow; truncate to maximum */
+  debt = gettotalbytes(g) - threshold;
+  if (debt > 0) debt = 0;
+  luaE_setdebt(g, debt);
+}
 
 
 /*
@@ -1289,6 +1307,15 @@ static void atomic2gen (lua_State *L, gl
 
 
 /*
+** Set debt for the next minor collection, which will happen when
+** memory grows 'genminormul'%.
+*/
+static void setminordebt (global_State *g) {
+  luaE_setdebt(g, -(cast(l_mem, (gettotalbytes(g) / 100)) * g->genminormul));
+}
+
+
+/*
 ** Enter generational mode. Must go until the end of an atomic cycle
 ** to ensure that all objects are correctly marked and weak tables
 ** are cleared. Then, turn all objects into old and finishes the
@@ -1300,6 +1327,7 @@ static lu_mem entergen (lua_State *L, gl
   luaC_runtilstate(L, bitmask(GCSpropagate));  /* start new cycle */
   numobjs = atomic(L);  /* propagates all and then do the atomic stuff */
   atomic2gen(L, g);
+  setminordebt(g);  /* set debt assuming next cycle will be minor */
   return numobjs;
 }
 
@@ -1346,15 +1374,6 @@ static lu_mem fullgen (lua_State *L, glo
 
 
 /*
-** Set debt for the next minor collection, which will happen when
-** memory grows 'genminormul'%.
-*/
-static void setminordebt (global_State *g) {
-  luaE_setdebt(g, -(cast(l_mem, (gettotalbytes(g) / 100)) * g->genminormul));
-}
-
-
-/*
 ** Does a major collection after last collection was a "bad collection".
 **
 ** When the program is building a big structure, it allocates lots of
@@ -1425,8 +1444,8 @@ static void genstep (lua_State *L, globa
   lu_mem numobjs = fullgen(L, g);  /* do a major collection */
   if (gettotalbytes(g) < majorbase + (majorinc / 2)) {
 /* collected at least half of memory growth since last major
-   collection; keep doing minor collections */
-setminordebt(g);
+   collection; keep doing minor collections. */
+lua_assert(g->lastatomic == 0);
   }
   else {  /* bad collection */
 g->lastatomic = numobjs;  /* signal that last collection was bad */
@@ -1453,26 +1472,6 @@ static void genstep (lua_State *L, globa
 
 
 /*
-** Set the "time" to wait before starting a new GC cycle; cycle will
-** start when memory use hits the threshold of ('estimate' * pause /
-** PAUSEADJ). (Division by 'estimate' should be OK: it cannot be zero,
-** because Lua cannot even start with less than PAUSEADJ bytes).
-*/
-static void setpause (global_State *g) {
-  l_mem threshold, debt;
-  int pause = getgcparam(g->gcpause);
-  l_mem estimate = g->GCestimate / PAUSEADJ;  /* adjust 'estimate' */
-  lua_assert(estimate > 0);
-  threshold = (pause < MAX_LMEM / estimate)  /* overflow? */
-? estimate * pause  /* no overflow */
-: MAX_LMEM;  /* overflow; truncate to maximum */
-  debt = gettotalbytes(g) - threshold;
-  if (debt > 0) debt = 0;
-  luaE_setdebt(g, debt);
-}
-
-
-/*
 ** Enter first sweep phase.
 ** The call to 'sweeptolive' makes the pointer point to an object
 ** inside the list (instead of to the header), so that the real sweep do



CVS commit: src/external/mit/lua/dist/src

2023-04-17 Thread Nikita
Module Name:src
Committed By:   nikita
Date:   Mon Apr 17 20:07:32 UTC 2023

Modified Files:
src/external/mit/lua/dist/src: lparser.c

Log Message:
lua: apply upstream bugfix for "'break' may not properly close variable in a 
'for' loop."

Function 'leaveblock' was generating "break" label before removing
variables from the closing block. If 'createlabel' created a 'close'
instruction (which it did when matching a goto/break that exited
the scope of an upvalue), that instruction would use the wrong level.


To generate a diff of this commit:
cvs rdiff -u -r1.13 -r1.14 src/external/mit/lua/dist/src/lparser.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/external/mit/lua/dist/src/lparser.c
diff -u src/external/mit/lua/dist/src/lparser.c:1.13 src/external/mit/lua/dist/src/lparser.c:1.14
--- src/external/mit/lua/dist/src/lparser.c:1.13	Mon Apr 17 19:17:49 2023
+++ src/external/mit/lua/dist/src/lparser.c	Mon Apr 17 20:07:32 2023
@@ -1,4 +1,4 @@
-/*	$NetBSD: lparser.c,v 1.13 2023/04/17 19:17:49 nikita Exp $	*/
+/*	$NetBSD: lparser.c,v 1.14 2023/04/17 20:07:32 nikita Exp $	*/
 
 /*
 ** Id: lparser.c 
@@ -678,19 +678,19 @@ static void leaveblock (FuncState *fs) {
   LexState *ls = fs->ls;
   int hasclose = 0;
   int stklevel = reglevel(fs, bl->nactvar);  /* level outside the block */
-  if (bl->isloop)  /* fix pending breaks? */
+  removevars(fs, bl->nactvar);  /* remove block locals */
+  lua_assert(bl->nactvar == fs->nactvar);  /* back to level on entry */
+  if (bl->isloop)  /* has to fix pending breaks? */
 hasclose = createlabel(ls, luaS_newliteral(ls->L, "break"), 0, 0);
-  if (!hasclose && bl->previous && bl->upval)
+  if (!hasclose && bl->previous && bl->upval)  /* still need a 'close'? */
 luaK_codeABC(fs, OP_CLOSE, stklevel, 0, 0);
-  fs->bl = bl->previous;
-  removevars(fs, bl->nactvar);
-  lua_assert(bl->nactvar == fs->nactvar);
   fs->freereg = stklevel;  /* free registers */
   ls->dyd->label.n = bl->firstlabel;  /* remove local labels */
-  if (bl->previous)  /* inner block? */
-movegotosout(fs, bl);  /* update pending gotos to outer block */
+  fs->bl = bl->previous;  /* current block now is previous one */
+  if (bl->previous)  /* was it a nested block? */
+movegotosout(fs, bl);  /* update pending gotos to enclosing block */
   else {
-if (bl->firstgoto < ls->dyd->gt.n)  /* pending gotos in outer block? */
+if (bl->firstgoto < ls->dyd->gt.n)  /* still pending gotos? */
   undefgoto(ls, >dyd->gt.arr[bl->firstgoto]);  /* error */
   }
 }



CVS commit: src/external/mit/lua/dist/src

2023-04-17 Thread Nikita
Module Name:src
Committed By:   nikita
Date:   Mon Apr 17 20:07:32 UTC 2023

Modified Files:
src/external/mit/lua/dist/src: lparser.c

Log Message:
lua: apply upstream bugfix for "'break' may not properly close variable in a 
'for' loop."

Function 'leaveblock' was generating "break" label before removing
variables from the closing block. If 'createlabel' created a 'close'
instruction (which it did when matching a goto/break that exited
the scope of an upvalue), that instruction would use the wrong level.


To generate a diff of this commit:
cvs rdiff -u -r1.13 -r1.14 src/external/mit/lua/dist/src/lparser.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.



CVS commit: src/external/mit/lua/dist/src

2023-04-17 Thread Nikita
Module Name:src
Committed By:   nikita
Date:   Mon Apr 17 19:54:19 UTC 2023

Modified Files:
src/external/mit/lua/dist/src: lapi.c ldo.c lfunc.c lfunc.h

Log Message:
lua: aply upstream bugfix for "'lua_settop' may use a pointer to stack 
invalidated by 'luaF_close'."


To generate a diff of this commit:
cvs rdiff -u -r1.13 -r1.14 src/external/mit/lua/dist/src/lapi.c
cvs rdiff -u -r1.10 -r1.11 src/external/mit/lua/dist/src/ldo.c
cvs rdiff -u -r1.9 -r1.10 src/external/mit/lua/dist/src/lfunc.c \
src/external/mit/lua/dist/src/lfunc.h

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/external/mit/lua/dist/src/lapi.c
diff -u src/external/mit/lua/dist/src/lapi.c:1.13 src/external/mit/lua/dist/src/lapi.c:1.14
--- src/external/mit/lua/dist/src/lapi.c:1.13	Sun Apr 16 20:46:17 2023
+++ src/external/mit/lua/dist/src/lapi.c	Mon Apr 17 19:54:19 2023
@@ -1,4 +1,4 @@
-/*	$NetBSD: lapi.c,v 1.13 2023/04/16 20:46:17 nikita Exp $	*/
+/*	$NetBSD: lapi.c,v 1.14 2023/04/17 19:54:19 nikita Exp $	*/
 
 /*
 ** Id: lapi.c 
@@ -208,7 +208,7 @@ LUA_API void lua_settop (lua_State *L, i
   newtop = L->top + diff;
   if (diff < 0 && L->tbclist >= newtop) {
 lua_assert(hastocloseCfunc(ci->nresults));
-luaF_close(L, newtop, CLOSEKTOP, 0);
+newtop = luaF_close(L, newtop, CLOSEKTOP, 0);
   }
   L->top = newtop;  /* correct top only after closing any upvalue */
   lua_unlock(L);
@@ -221,8 +221,7 @@ LUA_API void lua_closeslot (lua_State *L
   level = index2stack(L, idx);
   api_check(L, hastocloseCfunc(L->ci->nresults) && L->tbclist == level,
  "no variable to close at given level");
-  luaF_close(L, level, CLOSEKTOP, 0);
-  level = index2stack(L, idx);  /* stack may be moved */
+  level = luaF_close(L, level, CLOSEKTOP, 0);
   setnilvalue(s2v(level));
   lua_unlock(L);
 }

Index: src/external/mit/lua/dist/src/ldo.c
diff -u src/external/mit/lua/dist/src/ldo.c:1.10 src/external/mit/lua/dist/src/ldo.c:1.11
--- src/external/mit/lua/dist/src/ldo.c:1.10	Sun Apr 16 20:46:17 2023
+++ src/external/mit/lua/dist/src/ldo.c	Mon Apr 17 19:54:19 2023
@@ -1,4 +1,4 @@
-/*	$NetBSD: ldo.c,v 1.10 2023/04/16 20:46:17 nikita Exp $	*/
+/*	$NetBSD: ldo.c,v 1.11 2023/04/17 19:54:19 nikita Exp $	*/
 
 /*
 ** Id: ldo.c 
@@ -431,14 +431,15 @@ l_sinline void moveresults (lua_State *L
   break;
 default:  /* two/more results and/or to-be-closed variables */
   if (hastocloseCfunc(wanted)) {  /* to-be-closed variables? */
-ptrdiff_t savedres = savestack(L, res);
 L->ci->callstatus |= CIST_CLSRET;  /* in case of yields */
 L->ci->u2.nres = nres;
-luaF_close(L, res, CLOSEKTOP, 1);
+res = luaF_close(L, res, CLOSEKTOP, 1);
 L->ci->callstatus &= ~CIST_CLSRET;
-if (L->hookmask)  /* if needed, call hook after '__close's */
+if (L->hookmask) {  /* if needed, call hook after '__close's */
+  ptrdiff_t savedres = savestack(L, res);
   rethook(L, L->ci, nres);
-res = restorestack(L, savedres);  /* close and hook can move stack */
+  res = restorestack(L, savedres);  /* hook can move stack */
+}
 wanted = decodeNresults(wanted);
 if (wanted == LUA_MULTRET)
   wanted = nres;  /* we want all results */
@@ -655,8 +656,7 @@ static int finishpcallk (lua_State *L,  
   else {  /* error */
 StkId func = restorestack(L, ci->u2.funcidx);
 L->allowhook = getoah(ci->callstatus);  /* restore 'allowhook' */
-luaF_close(L, func, status, 1);  /* can yield or raise an error */
-func = restorestack(L, ci->u2.funcidx);  /* stack may be moved */
+func = luaF_close(L, func, status, 1);  /* can yield or raise an error */
 luaD_seterrorobj(L, status, func);
 luaD_shrinkstack(L);   /* restore stack size in case of overflow */
 setcistrecst(ci, LUA_OK);  /* clear original status */

Index: src/external/mit/lua/dist/src/lfunc.c
diff -u src/external/mit/lua/dist/src/lfunc.c:1.9 src/external/mit/lua/dist/src/lfunc.c:1.10
--- src/external/mit/lua/dist/src/lfunc.c:1.9	Sun Apr 16 20:46:17 2023
+++ src/external/mit/lua/dist/src/lfunc.c	Mon Apr 17 19:54:19 2023
@@ -1,4 +1,4 @@
-/*	$NetBSD: lfunc.c,v 1.9 2023/04/16 20:46:17 nikita Exp $	*/
+/*	$NetBSD: lfunc.c,v 1.10 2023/04/17 19:54:19 nikita Exp $	*/
 
 /*
 ** Id: lfunc.c 
@@ -227,9 +227,9 @@ static void poptbclist (lua_State *L) {
 
 /*
 ** Close all upvalues and to-be-closed variables up to the given stack
-** level.
+** level. Return restored 'level'.
 */
-void luaF_close (lua_State *L, StkId level, int status, int yy) {
+StkId luaF_close (lua_State *L, StkId level, int status, int yy) {
   ptrdiff_t levelrel = savestack(L, level);
   luaF_closeupval(L, level);  /* first, close the upvalues */
   while (L->tbclist >= level) {  /* traverse tbc's down to that level */
@@ -238,6 +238,7 @@ void luaF_close (lua_State *L, StkId lev
 prepcallclosemth(L, tbc, status, 

CVS commit: src/external/mit/lua/dist/src

2023-04-17 Thread Nikita
Module Name:src
Committed By:   nikita
Date:   Mon Apr 17 19:54:19 UTC 2023

Modified Files:
src/external/mit/lua/dist/src: lapi.c ldo.c lfunc.c lfunc.h

Log Message:
lua: aply upstream bugfix for "'lua_settop' may use a pointer to stack 
invalidated by 'luaF_close'."


To generate a diff of this commit:
cvs rdiff -u -r1.13 -r1.14 src/external/mit/lua/dist/src/lapi.c
cvs rdiff -u -r1.10 -r1.11 src/external/mit/lua/dist/src/ldo.c
cvs rdiff -u -r1.9 -r1.10 src/external/mit/lua/dist/src/lfunc.c \
src/external/mit/lua/dist/src/lfunc.h

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.



CVS commit: src/external/mit/lua/dist/src

2023-04-17 Thread Nikita
Module Name:src
Committed By:   nikita
Date:   Mon Apr 17 19:35:36 UTC 2023

Modified Files:
src/external/mit/lua/dist/src: ldebug.c lvm.c

Log Message:
lua: apply upstream bugfix for "Lua-stack overflow when C stack overflows while
handling an error." (CVE-2022-33099)

 Save stack space while handling errors

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".


To generate a diff of this commit:
cvs rdiff -u -r1.12 -r1.13 src/external/mit/lua/dist/src/ldebug.c
cvs rdiff -u -r1.15 -r1.16 src/external/mit/lua/dist/src/lvm.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.



CVS commit: src/external/mit/lua/dist/src

2023-04-17 Thread Nikita
Module Name:src
Committed By:   nikita
Date:   Mon Apr 17 19:35:36 UTC 2023

Modified Files:
src/external/mit/lua/dist/src: ldebug.c lvm.c

Log Message:
lua: apply upstream bugfix for "Lua-stack overflow when C stack overflows while
handling an error." (CVE-2022-33099)

 Save stack space while handling errors

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".


To generate a diff of this commit:
cvs rdiff -u -r1.12 -r1.13 src/external/mit/lua/dist/src/ldebug.c
cvs rdiff -u -r1.15 -r1.16 src/external/mit/lua/dist/src/lvm.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/external/mit/lua/dist/src/ldebug.c
diff -u src/external/mit/lua/dist/src/ldebug.c:1.12 src/external/mit/lua/dist/src/ldebug.c:1.13
--- src/external/mit/lua/dist/src/ldebug.c:1.12	Sun Apr 16 20:46:17 2023
+++ src/external/mit/lua/dist/src/ldebug.c	Mon Apr 17 19:35:36 2023
@@ -1,4 +1,4 @@
-/*	$NetBSD: ldebug.c,v 1.12 2023/04/16 20:46:17 nikita Exp $	*/
+/*	$NetBSD: ldebug.c,v 1.13 2023/04/17 19:35:36 nikita Exp $	*/
 
 /*
 ** Id: ldebug.c 
@@ -828,8 +828,11 @@ l_noret luaG_runerror (lua_State *L, con
   va_start(argp, fmt);
   msg = luaO_pushvfstring(L, fmt, argp);  /* format message */
   va_end(argp);
-  if (isLua(ci))  /* if Lua function, add source:line information */
+  if (isLua(ci)) {  /* if Lua function, add source:line information */
 luaG_addinfo(L, msg, ci_func(ci)->p->source, getcurrentline(ci));
+setobjs2s(L, L->top - 2, L->top - 1);  /* remove 'msg' from the stack */
+L->top--;
+  }
   luaG_errormsg(L);
 }
 

Index: src/external/mit/lua/dist/src/lvm.c
diff -u src/external/mit/lua/dist/src/lvm.c:1.15 src/external/mit/lua/dist/src/lvm.c:1.16
--- src/external/mit/lua/dist/src/lvm.c:1.15	Sun Apr 16 20:46:17 2023
+++ src/external/mit/lua/dist/src/lvm.c	Mon Apr 17 19:35:36 2023
@@ -1,4 +1,4 @@
-/*	$NetBSD: lvm.c,v 1.15 2023/04/16 20:46:17 nikita Exp $	*/
+/*	$NetBSD: lvm.c,v 1.16 2023/04/17 19:35:36 nikita Exp $	*/
 
 /*
 ** Id: lvm.c 
@@ -698,8 +698,10 @@ void luaV_concat (lua_State *L, int tota
   /* collect total length and number of strings */
   for (n = 1; n < total && tostring(L, s2v(top - n - 1)); n++) {
 size_t l = vslen(s2v(top - n - 1));
-if (l_unlikely(l >= (MAX_SIZE/sizeof(char)) - tl))
+if (l_unlikely(l >= (MAX_SIZE/sizeof(char)) - tl)) {
+  L->top = top - total;  /* pop strings to avoid wasting stack */
   luaG_runerror(L, "string length overflow");
+}
 tl += l;
   }
   if (tl <= LUAI_MAXSHORTLEN) {  /* is result a short string? */
@@ -714,7 +716,7 @@ void luaV_concat (lua_State *L, int tota
   setsvalue2s(L, top - n, ts);  /* create result */
 }
 total -= n-1;  /* got 'n' strings to create 1 new */
-L->top -= n-1;  /* popped 'n' strings and pushed one */
+L->top = top - (n - 1);  /* popped 'n' strings and pushed one */
   } while (total > 1);  /* repeat until only 1 result left */
 }
 



CVS commit: src/external/mit/lua/dist/src

2023-04-17 Thread Nikita
Module Name:src
Committed By:   nikita
Date:   Mon Apr 17 19:19:00 UTC 2023

Modified Files:
src/external/mit/lua/dist/src: lcode.c

Log Message:
lua: apply upstream bugfix for "Wrong code generation for constants in bitwise 
operations."


To generate a diff of this commit:
cvs rdiff -u -r1.12 -r1.13 src/external/mit/lua/dist/src/lcode.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/external/mit/lua/dist/src/lcode.c
diff -u src/external/mit/lua/dist/src/lcode.c:1.12 src/external/mit/lua/dist/src/lcode.c:1.13
--- src/external/mit/lua/dist/src/lcode.c:1.12	Sun Apr 16 20:46:17 2023
+++ src/external/mit/lua/dist/src/lcode.c	Mon Apr 17 19:19:00 2023
@@ -1,4 +1,4 @@
-/*	$NetBSD: lcode.c,v 1.12 2023/04/16 20:46:17 nikita Exp $	*/
+/*	$NetBSD: lcode.c,v 1.13 2023/04/17 19:19:00 nikita Exp $	*/
 
 /*
 ** Id: lcode.c 
@@ -1426,7 +1426,10 @@ static void finishbinexpval (FuncState *
 */
 static void codebinexpval (FuncState *fs, OpCode op,
expdesc *e1, expdesc *e2, int line) {
-  int v2 = luaK_exp2anyreg(fs, e2);  /* both operands are in registers */
+  int v2 = luaK_exp2anyreg(fs, e2);  /* make sure 'e2' is in a register */
+  /* 'e1' must be already in a register or it is a constant */
+  lua_assert((VNIL <= e1->k && e1->k <= VKSTR) ||
+ e1->k == VNONRELOC || e1->k == VRELOC);
   lua_assert(OP_ADD <= op && op <= OP_SHR);
   finishbinexpval(fs, e1, e2, op, v2, 0, line, OP_MMBIN,
   cast(TMS, (op - OP_ADD) + TM_ADD));
@@ -1513,7 +1516,7 @@ static void codecommutative (FuncState *
 
 
 /*
-** Code bitwise operations; they are all associative, so the function
+** Code bitwise operations; they are all commutative, so the function
 ** tries to put an integer constant as the 2nd operand (a K operand).
 */
 static void codebitwise (FuncState *fs, BinOpr opr,
@@ -1521,11 +1524,11 @@ static void codebitwise (FuncState *fs, 
   int flip = 0;
   int v2;
   OpCode op;
-  if (e1->k == VKINT && luaK_exp2RK(fs, e1)) {
+  if (e1->k == VKINT && luaK_exp2K(fs, e1)) {
 swapexps(e1, e2);  /* 'e2' will be the constant operand */
 flip = 1;
   }
-  else if (!(e2->k == VKINT && luaK_exp2RK(fs, e2))) {  /* no constants? */
+  else if (!(e2->k == VKINT && luaK_exp2K(fs, e2))) {  /* no constants? */
 op = cast(OpCode, opr + OP_ADD);
 codebinexpval(fs, op, e1, e2, line);  /* all-register opcodes */
 return;
@@ -1586,7 +1589,7 @@ static void codeeq (FuncState *fs, BinOp
 op = OP_EQI;
 r2 = im;  /* immediate operand */
   }
-  else if (luaK_exp2RK(fs, e2)) {  /* 1st expression is constant? */
+  else if (luaK_exp2RK(fs, e2)) {  /* 2nd expression is constant? */
 op = OP_EQK;
 r2 = e2->u.info;  /* constant index */
   }
@@ -1651,7 +1654,8 @@ void luaK_infix (FuncState *fs, BinOpr o
 case OPR_SHL: case OPR_SHR: {
   if (!tonumeral(v, NULL))
 luaK_exp2anyreg(fs, v);
-  /* else keep numeral, which may be folded with 2nd operand */
+  /* else keep numeral, which may be folded or used as an immediate
+operand */
   break;
 }
 case OPR_EQ: case OPR_NE: {



CVS commit: src/external/mit/lua/dist/src

2023-04-17 Thread Nikita
Module Name:src
Committed By:   nikita
Date:   Mon Apr 17 19:19:00 UTC 2023

Modified Files:
src/external/mit/lua/dist/src: lcode.c

Log Message:
lua: apply upstream bugfix for "Wrong code generation for constants in bitwise 
operations."


To generate a diff of this commit:
cvs rdiff -u -r1.12 -r1.13 src/external/mit/lua/dist/src/lcode.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.



CVS commit: src/external/mit/lua/dist/src

2023-04-17 Thread Nikita
Module Name:src
Committed By:   nikita
Date:   Mon Apr 17 19:17:49 UTC 2023

Modified Files:
src/external/mit/lua/dist/src: lparser.c

Log Message:
lua: apply upstream bugfix for "Lua can generate wrong code when _ENV is 
."


To generate a diff of this commit:
cvs rdiff -u -r1.12 -r1.13 src/external/mit/lua/dist/src/lparser.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.



CVS commit: src/external/mit/lua/dist/src

2023-04-17 Thread Nikita
Module Name:src
Committed By:   nikita
Date:   Mon Apr 17 19:17:49 UTC 2023

Modified Files:
src/external/mit/lua/dist/src: lparser.c

Log Message:
lua: apply upstream bugfix for "Lua can generate wrong code when _ENV is 
."


To generate a diff of this commit:
cvs rdiff -u -r1.12 -r1.13 src/external/mit/lua/dist/src/lparser.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/external/mit/lua/dist/src/lparser.c
diff -u src/external/mit/lua/dist/src/lparser.c:1.12 src/external/mit/lua/dist/src/lparser.c:1.13
--- src/external/mit/lua/dist/src/lparser.c:1.12	Sun Apr 16 20:46:17 2023
+++ src/external/mit/lua/dist/src/lparser.c	Mon Apr 17 19:17:49 2023
@@ -1,4 +1,4 @@
-/*	$NetBSD: lparser.c,v 1.12 2023/04/16 20:46:17 nikita Exp $	*/
+/*	$NetBSD: lparser.c,v 1.13 2023/04/17 19:17:49 nikita Exp $	*/
 
 /*
 ** Id: lparser.c 
@@ -472,6 +472,7 @@ static void singlevar (LexState *ls, exp
 expdesc key;
 singlevaraux(fs, ls->envn, var, 1);  /* get environment variable */
 lua_assert(var->k != VVOID);  /* this one must exist */
+luaK_exp2anyregup(fs, var);  /* but could be a constant */
 codestring(, varname);  /* key is variable name */
 luaK_indexed(fs, var, );  /* env[varname] */
   }



CVS commit: src/external/mit/lua/dist/src

2023-04-17 Thread Nikita
Module Name:src
Committed By:   nikita
Date:   Mon Apr 17 19:16:38 UTC 2023

Modified Files:
src/external/mit/lua/dist/src: lua.c

Log Message:
lua: Apply upstream bugfix for "lua.c assumes that argv has at least one 
element."


To generate a diff of this commit:
cvs rdiff -u -r1.10 -r1.11 src/external/mit/lua/dist/src/lua.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/external/mit/lua/dist/src/lua.c
diff -u src/external/mit/lua/dist/src/lua.c:1.10 src/external/mit/lua/dist/src/lua.c:1.11
--- src/external/mit/lua/dist/src/lua.c:1.10	Sun Apr 16 20:46:17 2023
+++ src/external/mit/lua/dist/src/lua.c	Mon Apr 17 19:16:38 2023
@@ -1,4 +1,4 @@
-/*	$NetBSD: lua.c,v 1.10 2023/04/16 20:46:17 nikita Exp $	*/
+/*	$NetBSD: lua.c,v 1.11 2023/04/17 19:16:38 nikita Exp $	*/
 
 /*
 ** Id: lua.c 
@@ -179,10 +179,11 @@ static void print_version (void) {
 ** to the script (everything after 'script') go to positive indices;
 ** other arguments (before the script name) go to negative indices.
 ** If there is no script name, assume interpreter's name as base.
+** (If there is no interpreter's name either, 'script' is -1, so
+** table sizes are zero.)
 */
 static void createargtable (lua_State *L, char **argv, int argc, int script) {
   int i, narg;
-  if (script == argc) script = 0;  /* no script name? */
   narg = argc - (script + 1);  /* number of positive indices */
   lua_createtable(L, narg, script + 1);
   for (i = 0; i < argc; i++) {
@@ -270,14 +271,23 @@ static int handle_script (lua_State *L, 
 
 /*
 ** Traverses all arguments from 'argv', returning a mask with those
-** needed before running any Lua code (or an error code if it finds
-** any invalid argument). 'first' returns the first not-handled argument
-** (either the script name or a bad argument in case of error).
+** needed before running any Lua code or an error code if it finds any
+** invalid argument. In case of error, 'first' is the index of the bad
+** argument.  Otherwise, 'first' is -1 if there is no program name,
+** 0 if there is no script name, or the index of the script name.
 */
 static int collectargs (char **argv, int *first) {
   int args = 0;
   int i;
-  for (i = 1; argv[i] != NULL; i++) {
+  if (argv[0] != NULL) {  /* is there a program name? */
+if (argv[0][0])  /* not empty? */
+  progname = argv[0];  /* save it */
+  }
+  else {  /* no program name */
+*first = -1;
+return 0;
+  }
+  for (i = 1; argv[i] != NULL; i++) {  /* handle arguments */
 *first = i;
 if (argv[i][0] != '-')  /* not an option? */
 return args;  /* stop handling options */
@@ -318,7 +328,7 @@ static int collectargs (char **argv, int
 return has_error;
 }
   }
-  *first = i;  /* no script name */
+  *first = 0;  /* no script name */
   return args;
 }
 
@@ -611,6 +621,7 @@ static int pmain (lua_State *L) {
   char **argv = (char **)lua_touserdata(L, 2);
   int script;
   int args = collectargs(argv, );
+  int optlim = (script > 0) ? script : argc; /* first argv not an option */
   luaL_checkversion(L);  /* check that interpreter has correct version */
   if (argv[0] && argv[0][0]) progname = argv[0];
   if (args == has_error) {  /* bad arg? */
@@ -630,14 +641,15 @@ static int pmain (lua_State *L) {
 if (handle_luainit(L) != LUA_OK)  /* run LUA_INIT */
   return 0;  /* error running LUA_INIT */
   }
-  if (!runargs(L, argv, script))  /* execute arguments -e and -l */
+  if (!runargs(L, argv, optlim))  /* execute arguments -e and -l */
 return 0;  /* something failed */
-  if (script < argc &&  /* execute main script (if there is one) */
-  handle_script(L, argv + script) != LUA_OK)
-return 0;
+  if (script > 0) {  /* execute main script (if there is one) */
+  if (handle_script(L, argv + script) != LUA_OK)
+return 0;
+  }
   if (args & has_i)  /* -i option? */
 doREPL(L);  /* do read-eval-print loop */
-  else if (script == argc && !(args & (has_e | has_v))) {  /* no arguments? */
+  else if (script < 1 && !(args & (has_e | has_v))) { /* no active option? */
 if (lua_stdin_is_tty()) {  /* running in interactive mode? */
   print_version();
   doREPL(L);  /* do read-eval-print loop */



CVS commit: src/external/mit/lua/dist/src

2023-04-17 Thread Nikita
Module Name:src
Committed By:   nikita
Date:   Mon Apr 17 19:16:38 UTC 2023

Modified Files:
src/external/mit/lua/dist/src: lua.c

Log Message:
lua: Apply upstream bugfix for "lua.c assumes that argv has at least one 
element."


To generate a diff of this commit:
cvs rdiff -u -r1.10 -r1.11 src/external/mit/lua/dist/src/lua.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.



Re: CVS commit: src/external/mit/lua/dist/src

2014-07-19 Thread Alexander Nasonov
Lourival Pereira Vieira Neto wrote:
 Module Name:  src
 Committed By: lneto
 Date: Sat Jul 19 17:11:53 UTC 2014
 
 Modified Files:
   src/external/mit/lua/dist/src: luaconf.h
 
 Log Message:
 lua(4): preventing division by zero
 
 * note: we should raise an error instead of return INTMAX_MAX

Userspace lua returns +inf or -inf. So, something like this would
be even better than your change:

#define luai_numdiv(a,b) \
((b) != 0 ? (a)/(b) : (a)  0 ?  INTMAX_MAX : INTMAX_MIN)

Alex


Re: CVS commit: src/external/mit/lua/dist/src

2012-03-15 Thread Bernd Ernesti
On Thu, Mar 15, 2012 at 01:25:06AM +, Alexander Nasonov wrote:
 Alexander Nasonov wrote:
  Log Message:
  Don't overwrite Roberto's external $Id.
 
 This made me realise that all external $Id were changed to Id
 by the previous import and that there is a script that does this
 replacement (external/mit/lua/dist/lua2netbsd). I will use it next
 time.
 
 Hopefully, everything else is fine, this was my first import over
 existing code.

It would be great to have a short summary in the cvs import log
what changed in the new version instead of just 'Import Lua 5.1.5'.
That doesn't have to be the full changelog.

Bernd



Re: CVS commit: src/external/mit/lua/dist/src

2012-03-15 Thread Iain Hibbert
On Thu, 15 Mar 2012, Alexander Nasonov wrote:

 Alexander Nasonov wrote:
  Log Message:
  Don't overwrite Roberto's external $Id.

 This made me realise that all external $Id were changed to Id
 by the previous import and that there is a script that does this
 replacement (external/mit/lua/dist/lua2netbsd). I will use it next
 time.

I think this script should not really be in the dist/ directory, but in
external/mit/lua/lua2netbsd

iain


Re: CVS commit: src/external/mit/lua/dist/src

2012-03-15 Thread Alexander Nasonov
Bernd Ernesti wrote:
 It would be great to have a short summary in the cvs import log
 what changed in the new version instead of just 'Import Lua 5.1.5'.
 That doesn't have to be the full changelog.

I agree. I was merely following comments in bind2netbsd script. Perhaps,
the comment should be changed to avoid confusion.

Alex


Re: CVS commit: src/external/mit/lua/dist/src

2012-03-14 Thread Alexander Nasonov
Alexander Nasonov wrote:
 Log Message:
 Don't overwrite Roberto's external $Id.

This made me realise that all external $Id were changed to Id
by the previous import and that there is a script that does this
replacement (external/mit/lua/dist/lua2netbsd). I will use it next
time.

Hopefully, everything else is fine, this was my first import over
existing code.

Alex


Re: CVS commit: src/external/mit/lua/dist/src

2012-03-14 Thread Christos Zoulas
In article 20120315012505.GA30246@x1000.localdomain,
Alexander Nasonov  al...@yandex.ru wrote:
Alexander Nasonov wrote:
 Log Message:
 Don't overwrite Roberto's external $Id.

This made me realise that all external $Id were changed to Id
by the previous import and that there is a script that does this
replacement (external/mit/lua/dist/lua2netbsd). I will use it next
time.

Hopefully, everything else is fine, this was my first import over
existing code.

You could just re-import it with the same tag on top.

christos