From f835c7569e9ae910e4780b3c5c00a6cb1bd07369 Mon Sep 17 00:00:00 2001 From: Cary R Date: Fri, 8 Aug 2008 16:34:24 -0700 Subject: [PATCH] Check for a possible corrupt function definition and return. If a function definition has no ports and no return type it is assumed to be a bad definition so we don't check it further. --- elab_sig.cc | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) diff --git a/elab_sig.cc b/elab_sig.cc index cccac8ba7..ae2221d1c 100644 --- a/elab_sig.cc +++ b/elab_sig.cc @@ -589,9 +589,17 @@ void PFunction::elaborate_sig(Design*des, NetScope*scope) const break; default: - cerr << get_fileline() << ": internal error: I don't know how " - << "to deal with return type of function " - << scope->basename() << "." << endl; + if (ports_) { + cerr << get_fileline() << ": internal error: I don't know " + << "how to deal with return type of function " + << scope->basename() << "." << endl; + } else { + /* If we do not have any ports or a return type this + * is probably a bad function definition. */ + cerr << get_fileline() << ": error: Bad definition for " + << "function " << scope->basename() << "?" << endl; + return; + } } svectorports (ports_? ports_->count() : 0);