From 25ef403c8edcea0cfeeda5aac912b8d33e088bf6 Mon Sep 17 00:00:00 2001 From: Danil Alexeev Date: Tue, 7 Apr 2026 14:19:54 +0300 Subject: [PATCH] GDScript: Replace incorrect usage of `GD_ERR_BREAK` --- modules/gdscript/gdscript_vm.cpp | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/modules/gdscript/gdscript_vm.cpp b/modules/gdscript/gdscript_vm.cpp index 6b8b0b6c2a..b470b15872 100644 --- a/modules/gdscript/gdscript_vm.cpp +++ b/modules/gdscript/gdscript_vm.cpp @@ -3813,7 +3813,10 @@ Variant GDScriptFunction::call(GDScriptInstance *p_instance, const Variant **p_a int globalname_idx = _code_ptr[ip + 2]; GD_ERR_BREAK(globalname_idx < 0 || globalname_idx >= _global_names_count); const StringName *globalname = &_global_names_ptr[globalname_idx]; - GD_ERR_BREAK(!GDScriptLanguage::get_singleton()->get_named_globals_map().has(*globalname)); + if (unlikely(!GDScriptLanguage::get_singleton()->get_named_globals_map().has(*globalname))) { + err_text = vformat(R"(Trying to access non-existent autoload singleton "%s".)", *globalname); + OPCODE_BREAK; + } GET_VARIANT_PTR(dst, 0); *dst = GDScriptLanguage::get_singleton()->get_named_globals_map()[*globalname];