From 3aa9d535f1efed2572c44eaeaf76fb3400cd5cf2 Mon Sep 17 00:00:00 2001 From: Michele Castellana Date: Thu, 30 Jun 2016 17:19:29 +0200 Subject: [PATCH] Avoid out of bounds --- net_scope.cc | 2 ++ 1 file changed, 2 insertions(+) diff --git a/net_scope.cc b/net_scope.cc index bae54dc07..42eab5a51 100644 --- a/net_scope.cc +++ b/net_scope.cc @@ -1,5 +1,6 @@ /* * Copyright (c) 2000-2016 Stephen Williams (steve@icarus.com) + * Copyright (c) 2016 CERN Michele Castellana (michele.castellana@cern.ch) * * This source code is free software; you can redistribute it * and/or modify it in source code form under the terms of the GNU @@ -508,6 +509,7 @@ void NetScope::add_module_port_info( unsigned idx, perm_string name, PortType::E unsigned long width ) { assert(type_ == MODULE); + assert(ports_.size() > idx); PortInfo &info = ports_[idx]; info.name = name; info.type = ptype;