diff options
| author | Liam <byteslice@airmail.cc> | 2023-02-24 12:29:55 -0500 |
|---|---|---|
| committer | Liam <byteslice@airmail.cc> | 2023-02-24 12:48:07 -0500 |
| commit | de4e5db3300cc77694ff154cf3e8a3ba9c9eaf78 (patch) | |
| tree | 65cfc240522bc045bd5e5de3c7e6530b26c7c482 /src/core/hle/service/hid/irs.h | |
| parent | ca8a804a3c28f53bba9d1f9080ae15c13f60ce9c (diff) | |
hid: avoid direct pointer access of transfer memory objects
Diffstat (limited to 'src/core/hle/service/hid/irs.h')
| -rw-r--r-- | src/core/hle/service/hid/irs.h | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/src/core/hle/service/hid/irs.h b/src/core/hle/service/hid/irs.h index 2e6115c73..b76ad7854 100644 --- a/src/core/hle/service/hid/irs.h +++ b/src/core/hle/service/hid/irs.h @@ -80,7 +80,13 @@ private: LOG_CRITICAL(Service_IRS, "Invalid index {}", index); return; } - processors[index] = std::make_unique<T>(system.HIDCore(), device_state, index); + + if constexpr (std::is_constructible_v<T, Core::System&, Core::IrSensor::DeviceFormat&, + std::size_t>) { + processors[index] = std::make_unique<T>(system, device_state, index); + } else { + processors[index] = std::make_unique<T>(system.HIDCore(), device_state, index); + } } template <typename T> |
