svn commit: r323533 - vendor-sys/illumos/dist/uts/common/fs/zfs/lua

Andriy Gapon avg at FreeBSD.org
Wed Sep 13 10:56:21 UTC 2017


Author: avg
Date: Wed Sep 13 10:56:19 2017
New Revision: 323533
URL: https://svnweb.freebsd.org/changeset/base/323533

Log:
  8552 ZFS LUA code uses floating point math
  
  illumos/illumos-gate at 916c8d881190bd2c3ca20d9fca919aecff504435
  https://github.com/illumos/illumos-gate/commit/916c8d881190bd2c3ca20d9fca919aecff504435
  
  https://www.illumos.org/issues/8552
    In the LUA interpreter used by "zfs program", the lua format() function
    accidentally includes support for '%f' and friends, which can cause compilation
    problems when building on platforms that don't support floating-point math in
    the kernel (e.g. sparc). Support for '%f' friends (%f %e %E %g %G) should be
    removed, since there's no way to supply a floating-point value anyway (all
    numbers in ZFS LUA are int64_t's).
  
  Reviewed by: Yuri Pankov <yuripv at gmx.com>
  Reviewed by: Igor Kozhukhov <igor at dilos.org>
  Approved by: Dan McDonald <danmcd at joyent.com>
  Author: Matthew Ahrens <mahrens at delphix.com>

Modified:
  vendor-sys/illumos/dist/uts/common/fs/zfs/lua/lstrlib.c

Modified: vendor-sys/illumos/dist/uts/common/fs/zfs/lua/lstrlib.c
==============================================================================
--- vendor-sys/illumos/dist/uts/common/fs/zfs/lua/lstrlib.c	Wed Sep 13 10:56:02 2017	(r323532)
+++ vendor-sys/illumos/dist/uts/common/fs/zfs/lua/lstrlib.c	Wed Sep 13 10:56:19 2017	(r323533)
@@ -958,6 +958,7 @@ static int str_format (lua_State *L) {
           nb = str_sprintf(buff, form, ni);
           break;
         }
+#if defined(LUA_USE_FLOAT_FORMATS)
         case 'e': case 'E': case 'f':
 #if defined(LUA_USE_AFORMAT)
         case 'a': case 'A':
@@ -967,6 +968,7 @@ static int str_format (lua_State *L) {
           nb = str_sprintf(buff, form, (LUA_FLTFRM_T)luaL_checknumber(L, arg));
           break;
         }
+#endif
         case 'q': {
           addquoted(L, &b, arg);
           break;


More information about the svn-src-vendor mailing list