mirror of
https://github.com/fish-shell/fish-shell.git
synced 2026-06-05 00:01:15 -03:00
Fix a few errors identified by testing new parser
This commit is contained in:
17
parser.cpp
17
parser.cpp
@@ -2615,6 +2615,8 @@ int parser_t::eval_new_parser(const wcstring &cmd, const io_chain_t &io, enum bl
|
||||
execution_contexts.push_back(ctx);
|
||||
|
||||
/* Start it up */
|
||||
const block_t * const start_current_block = current_block();
|
||||
this->push_block(new scope_block_t(block_type));
|
||||
int result = ctx->eval_top_level_job_list();
|
||||
|
||||
/* Clean up the execution context stack */
|
||||
@@ -2622,6 +2624,21 @@ int parser_t::eval_new_parser(const wcstring &cmd, const io_chain_t &io, enum bl
|
||||
execution_contexts.pop_back();
|
||||
delete ctx;
|
||||
|
||||
/* Clean up the block stack */
|
||||
this->pop_block();
|
||||
while (start_current_block != current_block())
|
||||
{
|
||||
if (current_block() == NULL)
|
||||
{
|
||||
debug(0,
|
||||
_(L"End of block mismatch. Program terminating."));
|
||||
bugreport();
|
||||
FATAL_EXIT();
|
||||
break;
|
||||
}
|
||||
this->pop_block();
|
||||
}
|
||||
|
||||
/* Reap again */
|
||||
job_reap(0);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user