summaryrefslogtreecommitdiff
path: root/modules/mono/mono_gd
diff options
context:
space:
mode:
authorIgnacio Etcheverry <neikeq@users.noreply.github.com>2017-10-07 22:10:02 +0200
committerGitHub <noreply@github.com>2017-10-07 22:10:02 +0200
commite5ff814243715ebf93962360060b7135edfa8f47 (patch)
tree0fc691d13ffd0f6a33fd8974190a8daaf3df01b6 /modules/mono/mono_gd
parent5a49106ff45be32018793eeca3fb168b3a374faf (diff)
parenteb920406ae0ddae54aafb866b23c218a12c18bb4 (diff)
Merge pull request #11924 from neikeq/b
Fix dot separated assembly names confused with file extensions
Diffstat (limited to 'modules/mono/mono_gd')
-rw-r--r--modules/mono/mono_gd/gd_mono.cpp3
-rw-r--r--modules/mono/mono_gd/gd_mono_assembly.cpp5
2 files changed, 3 insertions, 5 deletions
diff --git a/modules/mono/mono_gd/gd_mono.cpp b/modules/mono/mono_gd/gd_mono.cpp
index 98b57adc50..2c88832998 100644
--- a/modules/mono/mono_gd/gd_mono.cpp
+++ b/modules/mono/mono_gd/gd_mono.cpp
@@ -285,8 +285,7 @@ bool GDMono::_load_assembly(const String &p_name, GDMonoAssembly **r_assembly) {
MonoAssembly *assembly = mono_assembly_load_full(aname, NULL, &status, false);
mono_assembly_name_free(aname);
- if (!assembly)
- return false;
+ ERR_FAIL_NULL_V(assembly, false);
uint32_t domain_id = mono_domain_get_id(mono_domain_get());
diff --git a/modules/mono/mono_gd/gd_mono_assembly.cpp b/modules/mono/mono_gd/gd_mono_assembly.cpp
index f75f18e695..a623b34b68 100644
--- a/modules/mono/mono_gd/gd_mono_assembly.cpp
+++ b/modules/mono/mono_gd/gd_mono_assembly.cpp
@@ -47,18 +47,17 @@ MonoAssembly *GDMonoAssembly::_search_hook(MonoAssemblyName *aname, void *user_d
(void)user_data; // UNUSED
String name = mono_assembly_name_get_name(aname);
+ bool has_extension = name.ends_with(".dll") || name.ends_with(".exe");
if (no_search)
return NULL;
no_search = true; // Avoid the recursion madness
- GDMonoAssembly **loaded_asm = GDMono::get_singleton()->get_loaded_assembly(name.get_basename());
+ GDMonoAssembly **loaded_asm = GDMono::get_singleton()->get_loaded_assembly(has_extension ? name.get_basename() : name);
if (loaded_asm)
return (*loaded_asm)->get_assembly();
- bool has_extension = name.ends_with(".dll") || name.ends_with(".exe");
-
String path;
MonoAssembly *res = NULL;