From af70905246acfad225904b64d027e5b01c7b10eb Mon Sep 17 00:00:00 2001 From: Roberto Ierusalimschy Date: Mon, 18 Jun 2018 09:08:10 -0300 Subject: no need to check whether libraries and host use the same kernel; Lua should work correctly with several copies of the kernel --- lauxlib.c | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) (limited to 'lauxlib.c') diff --git a/lauxlib.c b/lauxlib.c index 215a83b1..a8f2cc2e 100644 --- a/lauxlib.c +++ b/lauxlib.c @@ -1,5 +1,5 @@ /* -** $Id: lauxlib.c,v 1.293 2018/02/21 13:48:44 roberto Exp roberto $ +** $Id: lauxlib.c,v 1.294 2018/02/27 18:47:32 roberto Exp roberto $ ** Auxiliary functions for building Lua libraries ** See Copyright Notice in lua.h */ @@ -950,13 +950,11 @@ LUALIB_API lua_State *luaL_newstate (void) { LUALIB_API void luaL_checkversion_ (lua_State *L, lua_Number ver, size_t sz) { - const lua_Number *v = lua_version(L); + lua_Number v = lua_version(L); if (sz != LUAL_NUMSIZES) /* check numeric types */ luaL_error(L, "core and library have incompatible numeric types"); - if (v != lua_version(NULL)) - luaL_error(L, "multiple Lua VMs detected"); - else if (*v != ver) + else if (v != ver) luaL_error(L, "version mismatch: app. needs %f, Lua core provides %f", - (LUAI_UACNUMBER)ver, (LUAI_UACNUMBER)*v); + (LUAI_UACNUMBER)ver, (LUAI_UACNUMBER)v); } -- cgit v1.2.3-55-g6feb