From 6183bf6cd7a8e6d4539849fdb93d087740c2769a Mon Sep 17 00:00:00 2001 From: Martin Whitaker Date: Fri, 23 May 2014 23:15:14 +0100 Subject: [PATCH] Fix for GitHub issue 26 - compiler crash when module port has no internal net. The compiler correctly reports an error when a module port has no associated internal net/reg, but could crash when the module was instantiated. --- elaborate.cc | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/elaborate.cc b/elaborate.cc index ec436b9b0..8ca2924a7 100644 --- a/elaborate.cc +++ b/elaborate.cc @@ -1,5 +1,5 @@ /* - * Copyright (c) 1998-2013 Stephen Williams (steve@icarus.com) + * Copyright (c) 1998-2014 Stephen Williams (steve@icarus.com) * * This source code is free software; you can redistribute it * and/or modify it in source code form under the terms of the GNU @@ -1170,6 +1170,10 @@ void PGModule::elaborate_mod_(Design*des, Module*rmod, NetScope*scope) const perm_string pname = peek_tail_name(mport[0]->path()); NetNet*tmp = instance[0]->find_signal(pname); + + // Handle the error case where there is no internal + // signal connected to the port. + if (!tmp) continue; ivl_assert(*this, tmp); if (tmp->port_type() == NetNet::PINPUT) {