summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRémi Verschelde <rverschelde@gmail.com>2024-05-07 13:48:36 +0200
committerRémi Verschelde <rverschelde@gmail.com>2024-05-07 13:48:36 +0200
commit0404e3a85e25e90c30bd492b0f282c572dba3520 (patch)
treeefa6b8c74407a31b05019d053f3f32c4c7c7c7b7
parente001bc75e8b9395186579e49620764fd05a2f97a (diff)
parentf4192aad6f6c46075c598ad9d6773fd919ced7fc (diff)
downloadredot-engine-0404e3a85e25e90c30bd492b0f282c572dba3520.tar.gz
Merge pull request #84148 from KANAjetzt/fix_crash_take_over_path_named_class
Fix crash when extending taken-over named class
-rw-r--r--modules/gdscript/gdscript_compiler.cpp3
1 files changed, 3 insertions, 0 deletions
diff --git a/modules/gdscript/gdscript_compiler.cpp b/modules/gdscript/gdscript_compiler.cpp
index 1f053be08d..01e5751dc8 100644
--- a/modules/gdscript/gdscript_compiler.cpp
+++ b/modules/gdscript/gdscript_compiler.cpp
@@ -2666,7 +2666,10 @@ Error GDScriptCompiler::_prepare_compilation(GDScript *p_script, const GDScriptP
GDScriptDataType base_type = _gdtype_from_datatype(p_class->base_type, p_script, false);
+ ERR_FAIL_COND_V_MSG(base_type.native_type == StringName(), ERR_BUG, vformat(R"(Failed to get base class for "%s")", p_script->path));
+
int native_idx = GDScriptLanguage::get_singleton()->get_global_map()[base_type.native_type];
+
p_script->native = GDScriptLanguage::get_singleton()->get_global_array()[native_idx];
ERR_FAIL_COND_V(p_script->native.is_null(), ERR_BUG);