From 45f27ffaab35542a419df7fcff6d74ae25806738 Mon Sep 17 00:00:00 2001 From: AJR Date: Thu, 30 Nov 2017 19:29:54 -0500 Subject: validity.cpp: Prevent insane recursion when multiple slot devices have the same tag (nw) --- src/emu/validity.cpp | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'src/emu/validity.cpp') 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); - if (slot != nullptr && !slot->fixed()) + if (slot != nullptr && !slot->fixed() && !duplicate) { for (auto &option : slot->option_list()) { -- cgit v1.2.3