summaryrefslogtreecommitdiff
path: root/modules/gdscript/gdscript_compiler.cpp
diff options
context:
space:
mode:
authorThakee Nathees <thakeenathees@gmail.com>2020-04-21 10:05:11 +0530
committerThakee Nathees <thakeenathees@gmail.com>2020-06-17 21:24:01 +0530
commit9325671faa9d8407996effd4366f47733a1ec21b (patch)
tree827c823743219b3ec2a0c273dbd7c7ded9133545 /modules/gdscript/gdscript_compiler.cpp
parent495b28765d03aa9459bc312ebba190ec208979e7 (diff)
GDScript debugger incorrect error line fixed
if the first line of an else or an elif throws a runtime error the debugger shows incorrect line number.
Diffstat (limited to 'modules/gdscript/gdscript_compiler.cpp')
-rw-r--r--modules/gdscript/gdscript_compiler.cpp4
1 files changed, 4 insertions, 0 deletions
diff --git a/modules/gdscript/gdscript_compiler.cpp b/modules/gdscript/gdscript_compiler.cpp
index 2bbec29043..5e428c7d2e 100644
--- a/modules/gdscript/gdscript_compiler.cpp
+++ b/modules/gdscript/gdscript_compiler.cpp
@@ -1381,6 +1381,10 @@ Error GDScriptCompiler::_parse_block(CodeGen &codegen, const GDScriptParser::Blo
codegen.opcodes.push_back(0);
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);
if (err2)
return err2;