diff --git a/rpcs3/Emu/Cell/PPUModule.cpp b/rpcs3/Emu/Cell/PPUModule.cpp index 76e895d512..9a76ec76b5 100644 --- a/rpcs3/Emu/Cell/PPUModule.cpp +++ b/rpcs3/Emu/Cell/PPUModule.cpp @@ -88,12 +88,26 @@ void ppu_module_manager::register_module(ppu_static_module* module) ppu_static_function& ppu_module_manager::access_static_function(const char* module, u32 fnid) { - return access().at(module)->functions[fnid]; + auto& res = access().at(module)->functions[fnid]; + + if (res.name) + { + fmt::throw_exception("PPU FNID duplication in module %s (%s, 0x%x)", module, res.name, fnid); + } + + return res; } ppu_static_variable& ppu_module_manager::access_static_variable(const char* module, u32 vnid) { - return access().at(module)->variables[vnid]; + auto& res = access().at(module)->variables[vnid]; + + if (res.name) + { + fmt::throw_exception("PPU VNID duplication in module %s (%s, 0x%x)", module, res.name, vnid); + } + + return res; } const ppu_static_module* ppu_module_manager::get_module(const std::string& name)