aboutsummaryrefslogtreecommitdiffhomepage
path: root/parser.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'parser.cpp')
-rw-r--r--parser.cpp7
1 files changed, 7 insertions, 0 deletions
diff --git a/parser.cpp b/parser.cpp
index c6052781..bd0471df 100644
--- a/parser.cpp
+++ b/parser.cpp
@@ -2602,6 +2602,13 @@ int parser_t::eval_new_parser(const wcstring &cmd, const io_chain_t &io, enum bl
{
CHECK_BLOCK(1);
+ if (block_type != TOP && block_type != SUBST)
+ {
+ debug(1, INVALID_SCOPE_ERR_MSG, parser_t::get_block_desc(block_type));
+ bugreport();
+ return 1;
+ }
+
/* Parse the source into a tree, if we can */
parse_node_tree_t tree;
if (! parse_t::parse(cmd, parse_flag_none, &tree, NULL))