mirror of
https://github.com/neovim/neovim.git
synced 2025-09-24 20:18:32 +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:
@@ -147,7 +147,7 @@ static inline int json_decoder_pop(ValuesStackItem obj,
|
||||
tv_clear(&key.val);
|
||||
if (tv_dict_add(last_container.container.vval.v_dict, obj_di)
|
||||
== FAIL) {
|
||||
assert(false);
|
||||
abort();
|
||||
}
|
||||
obj_di->di_tv = obj.val;
|
||||
} else {
|
||||
@@ -480,7 +480,7 @@ static inline int parse_json_string(const char *const buf, const size_t buf_len,
|
||||
break;
|
||||
}
|
||||
default: {
|
||||
assert(false);
|
||||
abort();
|
||||
}
|
||||
}
|
||||
} else {
|
||||
|
Reference in New Issue
Block a user