diff options
author | James McCoy <jamessan@jamessan.com> | 2021-01-31 10:43:03 -0500 |
---|---|---|
committer | James McCoy <jamessan@jamessan.com> | 2021-01-31 11:28:52 -0500 |
commit | 27a7a4d38405a30611339fc663e426904bda1099 (patch) | |
tree | 23935162b10ba9fa607df9a35ea3b3da7ea9349e /src/nvim/eval/decode.c | |
parent | 035ee868ae2d9cbbf2a290ca3412946fade20833 (diff) | |
download | rneovim-27a7a4d38405a30611339fc663e426904bda1099.tar.gz rneovim-27a7a4d38405a30611339fc663e426904bda1099.tar.bz2 rneovim-27a7a4d38405a30611339fc663e426904bda1099.zip |
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.
Diffstat (limited to 'src/nvim/eval/decode.c')
-rw-r--r-- | src/nvim/eval/decode.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/src/nvim/eval/decode.c b/src/nvim/eval/decode.c index 638fef331a..bd4dc87d31 100644 --- a/src/nvim/eval/decode.c +++ b/src/nvim/eval/decode.c @@ -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 { |