diff options
author | Bram Moolenaar <Bram@vim.org> | 2020-01-11 16:05:23 +0100 |
---|---|---|
committer | Bram Moolenaar <Bram@vim.org> | 2020-01-11 16:05:23 +0100 |
commit | 9b4a15d5dba354d2e1e02871470bad103f34769a (patch) | |
tree | e5e49ad3182e07e641cdea0e04c4a8078186c58c /src/if_lua.c | |
parent | e05a89ac6399a8c7d164c99fdab6841d999a9128 (diff) |
patch 8.2.0111: VAR_SPECIAL is also used for booleansv8.2.0111
Problem: VAR_SPECIAL is also used for booleans.
Solution: Add VAR_BOOL for better type checking.
Diffstat (limited to 'src/if_lua.c')
-rw-r--r-- | src/if_lua.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/src/if_lua.c b/src/if_lua.c index 9b03c97aa8..b80b6c9e26 100644 --- a/src/if_lua.c +++ b/src/if_lua.c @@ -535,6 +535,7 @@ luaV_pushtypval(lua_State *L, typval_T *tv) case VAR_DICT: luaV_pushdict(L, tv->vval.v_dict); break; + case VAR_BOOL: case VAR_SPECIAL: if (tv->vval.v_number <= VVAL_TRUE) lua_pushinteger(L, (int) tv->vval.v_number); @@ -564,7 +565,7 @@ luaV_totypval(lua_State *L, int pos, typval_T *tv) switch (lua_type(L, pos)) { case LUA_TBOOLEAN: - tv->v_type = VAR_SPECIAL; + tv->v_type = VAR_BOOL; tv->vval.v_number = (varnumber_T) lua_toboolean(L, pos); break; case LUA_TNIL: |