diff options
Diffstat (limited to 'lauxlib.c')
| -rw-r--r-- | lauxlib.c | 10 |
1 files changed, 4 insertions, 6 deletions
| @@ -1,5 +1,5 @@ | |||
| 1 | /* | 1 | /* |
| 2 | ** $Id: lauxlib.c,v 1.293 2018/02/21 13:48:44 roberto Exp roberto $ | 2 | ** $Id: lauxlib.c,v 1.294 2018/02/27 18:47:32 roberto Exp roberto $ |
| 3 | ** Auxiliary functions for building Lua libraries | 3 | ** Auxiliary functions for building Lua libraries |
| 4 | ** See Copyright Notice in lua.h | 4 | ** See Copyright Notice in lua.h |
| 5 | */ | 5 | */ |
| @@ -950,13 +950,11 @@ LUALIB_API lua_State *luaL_newstate (void) { | |||
| 950 | 950 | ||
| 951 | 951 | ||
| 952 | LUALIB_API void luaL_checkversion_ (lua_State *L, lua_Number ver, size_t sz) { | 952 | LUALIB_API void luaL_checkversion_ (lua_State *L, lua_Number ver, size_t sz) { |
| 953 | const lua_Number *v = lua_version(L); | 953 | lua_Number v = lua_version(L); |
| 954 | if (sz != LUAL_NUMSIZES) /* check numeric types */ | 954 | if (sz != LUAL_NUMSIZES) /* check numeric types */ |
| 955 | luaL_error(L, "core and library have incompatible numeric types"); | 955 | luaL_error(L, "core and library have incompatible numeric types"); |
| 956 | if (v != lua_version(NULL)) | 956 | else if (v != ver) |
| 957 | luaL_error(L, "multiple Lua VMs detected"); | ||
| 958 | else if (*v != ver) | ||
| 959 | luaL_error(L, "version mismatch: app. needs %f, Lua core provides %f", | 957 | luaL_error(L, "version mismatch: app. needs %f, Lua core provides %f", |
| 960 | (LUAI_UACNUMBER)ver, (LUAI_UACNUMBER)*v); | 958 | (LUAI_UACNUMBER)ver, (LUAI_UACNUMBER)v); |
| 961 | } | 959 | } |
| 962 | 960 | ||
