Merge pull request #38067 from ThakeeNathees/elif-error-line-fixed

GDScript debugger incorrect error line fixed
This commit is contained in:
Rémi Verschelde 2020-06-17 19:17:44 +02:00 committed by GitHub
commit d341181f30
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 4 additions and 0 deletions

View File

@ -1422,6 +1422,10 @@ Error GDScriptCompiler::_parse_block(CodeGen &codegen, const GDScriptParser::Blo
codegen.opcodes.push_back(0); codegen.opcodes.push_back(0);
codegen.opcodes.write[else_addr] = codegen.opcodes.size(); codegen.opcodes.write[else_addr] = codegen.opcodes.size();
codegen.opcodes.push_back(GDScriptFunction::OPCODE_LINE);
codegen.opcodes.push_back(cf->body_else->line);
codegen.current_line = cf->body_else->line;
Error err2 = _parse_block(codegen, cf->body_else, p_stack_level, p_break_addr, p_continue_addr); Error err2 = _parse_block(codegen, cf->body_else, p_stack_level, p_break_addr, p_continue_addr);
if (err2) { if (err2) {
return err2; return err2;