mirror of
https://github.com/neovim/neovim.git
synced 2025-09-30 06:58:35 +00:00
Use abort() instead of assert(false) for things that should never happen
assert() is compiled out for release builds, but we don't want to continue running in these impossible situations. This also resolves the "implicit fallthrough" warnings for the asserts in switch cases.
This commit is contained in:
@@ -245,7 +245,7 @@ bool nlua_pop_typval(lua_State *lstate, typval_T *ret_tv)
|
||||
} else {
|
||||
dictitem_T *const di = tv_dict_item_alloc_len(s, len);
|
||||
if (tv_dict_add(cur.tv->vval.v_dict, di) == FAIL) {
|
||||
assert(false);
|
||||
abort();
|
||||
}
|
||||
kv_push(stack, cur);
|
||||
cur = (TVPopStackItem) { &di->di_tv, false, false, 0 };
|
||||
@@ -391,7 +391,7 @@ bool nlua_pop_typval(lua_State *lstate, typval_T *ret_tv)
|
||||
break;
|
||||
}
|
||||
default: {
|
||||
assert(false);
|
||||
abort();
|
||||
}
|
||||
}
|
||||
nlua_pop_typval_table_processing_end:
|
||||
@@ -1200,7 +1200,7 @@ Object nlua_pop_Object(lua_State *const lstate, bool ref, Error *const err)
|
||||
break;
|
||||
}
|
||||
default: {
|
||||
assert(false);
|
||||
abort();
|
||||
}
|
||||
}
|
||||
break;
|
||||
|
Reference in New Issue
Block a user