From a0969662cdfe6e00b6c42e15bb5775ee5eb5d79b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Pedro=20J=2E=20Est=C3=A9banez?= Date: Wed, 9 Sep 2020 13:05:28 +0200 Subject: [PATCH 1/2] Prevent cyclic reference between script and its members --- modules/gdscript/gdscript_compiler.cpp | 22 ++++++++++++++-------- modules/gdscript/gdscript_compiler.h | 2 +- modules/gdscript/gdscript_editor.cpp | 2 +- modules/gdscript/gdscript_function.h | 6 ++++-- modules/gdscript/gdscript_parser.cpp | 2 +- 5 files changed, 21 insertions(+), 13 deletions(-) diff --git a/modules/gdscript/gdscript_compiler.cpp b/modules/gdscript/gdscript_compiler.cpp index b175290698cc..534c49a94463 100644 --- a/modules/gdscript/gdscript_compiler.cpp +++ b/modules/gdscript/gdscript_compiler.cpp @@ -111,7 +111,7 @@ bool GDScriptCompiler::_create_binary_operator(CodeGen &codegen, const GDScriptP return true; } -GDScriptDataType GDScriptCompiler::_gdtype_from_datatype(const GDScriptParser::DataType &p_datatype) const { +GDScriptDataType GDScriptCompiler::_gdtype_from_datatype(const GDScriptParser::DataType &p_datatype, GDScript *p_owner) const { if (!p_datatype.has_type) { return GDScriptDataType(); } @@ -130,12 +130,12 @@ GDScriptDataType GDScriptCompiler::_gdtype_from_datatype(const GDScriptParser::D } break; case GDScriptParser::DataType::SCRIPT: { result.kind = GDScriptDataType::SCRIPT; - result.script_type = p_datatype.script_type; + result.script_type = Ref