summaryrefslogtreecommitdiffstatshomepage
path: root/src/emu/devfind.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/emu/devfind.h')
-rw-r--r--src/emu/devfind.h16
1 files changed, 6 insertions, 10 deletions
diff --git a/src/emu/devfind.h b/src/emu/devfind.h
index d49d48be6c9..1fe2ed78439 100644
--- a/src/emu/devfind.h
+++ b/src/emu/devfind.h
@@ -508,6 +508,8 @@ template <class DeviceClass, bool Required>
class device_finder : public object_finder_base<DeviceClass, Required>
{
public:
+ using object_finder_base<DeviceClass, Required>::set_tag;
+
/// \brief Device finder constructor
/// \param [in] base Base device to search from.
/// \param [in] tag Device tag to search for. This is not copied,
@@ -518,19 +520,13 @@ public:
/// \brief Set search tag
///
/// Allows search tag to be changed after construction. Note that
- /// this must be done before resolution time to take effect.
+ /// this must be done before resolution time to take effect. Note
+ /// that this binds to a particular instance, so the device must not
+ /// be removed or replaced, as it will cause a use-after-free when
+ /// resolving objects.
/// \param [in] object Object to refer to.
void set_tag(DeviceClass &object) { set_tag(object, DEVICE_SELF); }
- /// \brief Set search tag
- ///
- /// Allows search tag to be changed after construction. Note that
- /// this must be done before resolution time to take effect.
- /// \param [in] object Object to refer to.
- void set_tag(DeviceClass *object) { assert(object != nullptr); set_tag(*object, DEVICE_SELF); }
-
- using object_finder_base<DeviceClass, Required>::set_tag;
-
/// \brief Set target during configuration
///
/// During configuration, device_finder instances may be assigned