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/viml/parser/expressions.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/viml/parser/expressions.c')
-rw-r--r-- | src/nvim/viml/parser/expressions.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/src/nvim/viml/parser/expressions.c b/src/nvim/viml/parser/expressions.c index 44b6ab5f5a..e9d82ca87d 100644 --- a/src/nvim/viml/parser/expressions.c +++ b/src/nvim/viml/parser/expressions.c @@ -2078,7 +2078,7 @@ viml_pexpr_parse_process_token: case kExprLexMissing: case kExprLexSpacing: case kExprLexEOC: { - assert(false); + abort(); } case kExprLexInvalid: { ERROR_FROM_TOKEN(cur_token); @@ -3028,7 +3028,7 @@ viml_pexpr_parse_end: // Until trailing "}" it is impossible to distinguish curly braces // identifier and dictionary, so it must not appear in the stack like // this. - assert(false); + abort(); } case kExprNodeInteger: case kExprNodeFloat: @@ -3042,7 +3042,7 @@ viml_pexpr_parse_end: // These are plain values and not containers, for them it should only // be possible to show up in the topmost stack element, but it was // unconditionally popped at the start. - assert(false); + abort(); } case kExprNodeComma: case kExprNodeColon: |