parse_execution.cpp: validate 'for' variable name

Fixes #5800
(that's a nice round number)
This commit is contained in:
Aaron Gyes 2019-04-08 11:22:21 -07:00
parent dd9a26715d
commit 8eb05f8731

View File

@ -396,6 +396,11 @@ parse_execution_result_t parse_execution_context_t::run_for_statement(
}
}
if (!valid_var_name(for_var_name)) {
report_error(var_name_node, L"invalid var name: %ls", for_var_name.c_str());
return parse_execution_errored;
}
for_block_t *fb = parser->push_block<for_block_t>();
// Now drive the for loop.