From bf1a504545b2f10c0d4ef297ffe3ff994fcb0070 Mon Sep 17 00:00:00 2001 From: couriersud Date: Tue, 27 Dec 2016 03:17:53 +0100 Subject: Fix nullptr exception. (nw) --- src/lib/netlist/devices/nld_9312.cpp | 3 ++- src/lib/netlist/devices/nld_truthtable.h | 2 +- src/lib/netlist/devices/nlid_system.h | 5 ++--- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/src/lib/netlist/devices/nld_9312.cpp b/src/lib/netlist/devices/nld_9312.cpp index af5f35d965c..2ad298f368a 100644 --- a/src/lib/netlist/devices/nld_9312.cpp +++ b/src/lib/netlist/devices/nld_9312.cpp @@ -28,8 +28,9 @@ namespace netlist namespace devices { #if (USE_TRUTHTABLE) - /* The truthtable implementation is a lot faster than + /* FIXME: The truthtable implementation is a lot faster than * the carefully crafted code :-( + * Convert this into a macro module. */ NETLIB_TRUTHTABLE(9312, 12, 2); #else diff --git a/src/lib/netlist/devices/nld_truthtable.h b/src/lib/netlist/devices/nld_truthtable.h index 759d19cf0c9..6fcd746578f 100644 --- a/src/lib/netlist/devices/nld_truthtable.h +++ b/src/lib/netlist/devices/nld_truthtable.h @@ -23,7 +23,7 @@ public: \ template \ NETLIB_NAME(cname)(C &owner, const pstring &name) \ - : nld_truthtable_t(owner, name, nullptr, &m_ttbl, m_desc) { } \ + : nld_truthtable_t(owner, name, family_TTL(), &m_ttbl, m_desc) { } \ private: \ static truthtable_t m_ttbl; \ static const char *m_desc[]; \ diff --git a/src/lib/netlist/devices/nlid_system.h b/src/lib/netlist/devices/nlid_system.h index 5feb057af6c..05b7925bdb0 100644 --- a/src/lib/netlist/devices/nlid_system.h +++ b/src/lib/netlist/devices/nlid_system.h @@ -472,9 +472,8 @@ namespace netlist NETLIB_UPDATEI() { - if (!m_logic_family) - m_Q.push(m_I.Q_Analog() > 0.7, NLTIME_FROM_NS(1)); - else if (m_I.Q_Analog() > logic_family().m_high_thresh_V) + nl_assert(m_logic_family != nullptr); + if (m_I.Q_Analog() > logic_family().m_high_thresh_V) m_Q.push(1, NLTIME_FROM_NS(1)); else if (m_I.Q_Analog() < logic_family().m_low_thresh_V) m_Q.push(0, NLTIME_FROM_NS(1)); -- cgit v1.2.3