diff options
| author | 2017-11-30 19:29:54 -0500 | |
|---|---|---|
| committer | 2017-11-30 19:34:03 -0500 | |
| commit | 45f27ffaab35542a419df7fcff6d74ae25806738 (patch) | |
| tree | dd3423cfd18ddeacb86d4eb7757fc0a4ae28eaa5 /src/emu/validity.cpp | |
| parent | c00efe9e953d158057ba4d966a8cf30fee002d89 (diff) | |
validity.cpp: Prevent insane recursion when multiple slot devices have the same tag (nw)
Diffstat (limited to 'src/emu/validity.cpp')
| -rw-r--r-- | src/emu/validity.cpp | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/src/emu/validity.cpp b/src/emu/validity.cpp index dd70af41506..a7e87c39f12 100644 --- a/src/emu/validity.cpp +++ b/src/emu/validity.cpp @@ -1921,7 +1921,8 @@ void validity_checker::validate_devices() validate_tag(device.basetag()); // look for duplicates - if (!device_map.insert(device.tag()).second) + bool duplicate = !device_map.insert(device.tag()).second; + if (duplicate) osd_printf_error("Multiple devices with the same tag defined\n"); // check for device-specific validity check @@ -1932,7 +1933,7 @@ void validity_checker::validate_devices() // if it's a slot, iterate over possible cards (don't recurse, or you'll stack infinite tee connectors) device_slot_interface *const slot = dynamic_cast<device_slot_interface *>(&device); - if (slot != nullptr && !slot->fixed()) + if (slot != nullptr && !slot->fixed() && !duplicate) { for (auto &option : slot->option_list()) { |
