mirror of
https://github.com/holub/mame
synced 2025-10-05 08:41:31 +03:00
detect parent/clone loops rather than extending a string forever
This commit is contained in:
parent
f15068fccb
commit
553d973126
@ -53,8 +53,13 @@ void driver_device::set_game_driver(const game_driver &game)
|
||||
|
||||
// and set the search path to include all parents
|
||||
m_searchpath = game.name;
|
||||
std::set<game_driver const *> seen;
|
||||
for (int parent = driver_list::clone(game); parent != -1; parent = driver_list::clone(parent))
|
||||
{
|
||||
if (!seen.insert(&driver_list::driver(parent)).second)
|
||||
throw emu_fatalerror("driver_device::set_game_driver(%s): parent/clone relationships form a loop", game.name);
|
||||
m_searchpath.append(";").append(driver_list::driver(parent).name);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user