From a68fe8ea0a76a396b7ba14339bd227c2c9b5a1fb Mon Sep 17 00:00:00 2001 From: Lars-Peter Clausen Date: Fri, 14 Apr 2023 07:12:18 -0700 Subject: [PATCH] Initialize NetNet::port_index_ The port_index_ member of the NetNet is not initialized which can lead to undefined behavior. Make sure to initialize to -1 to indicate that the net is not associated with any port. Signed-off-by: Lars-Peter Clausen --- netlist.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/netlist.h b/netlist.h index 56ae221ff..3e1f48a9a 100644 --- a/netlist.h +++ b/netlist.h @@ -825,7 +825,7 @@ class NetNet : public NetObj, public PortType { std::vector lref_mask_; std::vector delay_paths_; - int port_index_; + int port_index_ = -1; }; /*