Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 13 Sep 2017 10:56:19 +0000 (UTC)
From:      Andriy Gapon <avg@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-vendor@freebsd.org
Subject:   svn commit: r323533 - vendor-sys/illumos/dist/uts/common/fs/zfs/lua
Message-ID:  <201709131056.v8DAuJKs068135@repo.freebsd.org>

next in thread | raw e-mail | index | archive | help
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@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@gmx.com>
  Reviewed by: Igor Kozhukhov <igor@dilos.org>
  Approved by: Dan McDonald <danmcd@joyent.com>
  Author: Matthew Ahrens <mahrens@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;



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201709131056.v8DAuJKs068135>