Fix dot separated assembly names confused with file extensions

This commit is contained in:
Ignacio Etcheverry 2017-10-07 22:00:30 +02:00
parent 5ab3537179
commit eb920406ae
2 changed files with 3 additions and 5 deletions

View File

@ -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); MonoAssembly *assembly = mono_assembly_load_full(aname, NULL, &status, false);
mono_assembly_name_free(aname); mono_assembly_name_free(aname);
if (!assembly) ERR_FAIL_NULL_V(assembly, false);
return false;
uint32_t domain_id = mono_domain_get_id(mono_domain_get()); uint32_t domain_id = mono_domain_get_id(mono_domain_get());

View File

@ -47,18 +47,17 @@ MonoAssembly *GDMonoAssembly::_search_hook(MonoAssemblyName *aname, void *user_d
(void)user_data; // UNUSED (void)user_data; // UNUSED
String name = mono_assembly_name_get_name(aname); String name = mono_assembly_name_get_name(aname);
bool has_extension = name.ends_with(".dll") || name.ends_with(".exe");
if (no_search) if (no_search)
return NULL; return NULL;
no_search = true; // Avoid the recursion madness 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) if (loaded_asm)
return (*loaded_asm)->get_assembly(); return (*loaded_asm)->get_assembly();
bool has_extension = name.ends_with(".dll") || name.ends_with(".exe");
String path; String path;
MonoAssembly *res = NULL; MonoAssembly *res = NULL;