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 */
/*