From e063e17a1f9a182eba7b8babd126ba34a8af79e0 Mon Sep 17 00:00:00 2001 From: Aaron Rossetto Date: Thu, 21 May 2020 09:05:34 -0500 Subject: rfnoc: Fix _has_port() port existence check This commit fixes a bug in node_t::_has_port(), which was using the wrong comparison operator to determine if the instance value in the incoming res_source_info parameter is within a valid range. --- host/lib/rfnoc/node.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'host/lib') diff --git a/host/lib/rfnoc/node.cpp b/host/lib/rfnoc/node.cpp index ff3df7b76..7cc656a26 100644 --- a/host/lib/rfnoc/node.cpp +++ b/host/lib/rfnoc/node.cpp @@ -581,7 +581,7 @@ void node_t::shutdown() bool node_t::_has_port(const res_source_info& port_info) const { return (port_info.type == res_source_info::INPUT_EDGE - && port_info.instance <= get_num_input_ports()) + && port_info.instance < get_num_input_ports()) || (port_info.type == res_source_info::OUTPUT_EDGE - && port_info.instance <= get_num_output_ports()); + && port_info.instance < get_num_output_ports()); } -- cgit v1.2.3