aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorZyX <kp-pav@yandex.ru>2017-10-29 01:29:48 +0300
committerZyX <kp-pav@yandex.ru>2017-10-29 01:29:48 +0300
commit568cf73c90af2966ee091f2180905a8cf9582064 (patch)
tree71b9eee7d5b46b57a9306f577dc6819c8370c234
parentb574e95850c064d4e746a7373aff1a3d7bd4de27 (diff)
downloadrneovim-568cf73c90af2966ee091f2180905a8cf9582064.tar.gz
rneovim-568cf73c90af2966ee091f2180905a8cf9582064.tar.bz2
rneovim-568cf73c90af2966ee091f2180905a8cf9582064.zip
viml/parser/expressions: Fix last error found by KLEE
-rw-r--r--src/nvim/viml/parser/expressions.c1
-rw-r--r--test/unit/viml/expressions/parser_spec.lua20
2 files changed, 20 insertions, 1 deletions
diff --git a/src/nvim/viml/parser/expressions.c b/src/nvim/viml/parser/expressions.c
index da22cf4cdb..b413d56592 100644
--- a/src/nvim/viml/parser/expressions.c
+++ b/src/nvim/viml/parser/expressions.c
@@ -2445,6 +2445,7 @@ viml_pexpr_parse_bracket_closing_error:
cur_node->children = *top_node_p;
}
*top_node_p = cur_node;
+ new_top_node_p = top_node_p;
goto viml_pexpr_parse_figure_brace_closing_error;
}
if (want_node == kENodeValue) {
diff --git a/test/unit/viml/expressions/parser_spec.lua b/test/unit/viml/expressions/parser_spec.lua
index b81a3c0f82..f3d0790e68 100644
--- a/test/unit/viml/expressions/parser_spec.lua
+++ b/test/unit/viml/expressions/parser_spec.lua
@@ -7120,7 +7120,25 @@ describe('Expressions parser', function()
hl('InvalidDoubleQuotedString', '"'),
hl('InvalidDoubleQuotedEscape', '\\1'),
})
- check_parsing('}l')
+ check_parsing('}l', 0, {
+ -- 01
+ ast = {
+ {
+ 'OpMissing:0:1:',
+ children = {
+ 'UnknownFigure(---):0:0:',
+ 'PlainIdentifier(scope=0,ident=l):0:1:l',
+ },
+ },
+ },
+ err = {
+ arg = '}l',
+ msg = 'E15: Unexpected closing figure brace: %.*s',
+ },
+ }, {
+ hl('InvalidFigureBrace', '}'),
+ hl('InvalidIdentifier', 'l'),
+ })
check_parsing(':?\000\000\000\000\000\000\000', 0, {
ast = {
{