From c92b37b1bdb08b3a3b5c5b3c670090f80cc8eb8d Mon Sep 17 00:00:00 2001 From: Stephen Williams Date: Tue, 4 Sep 2007 16:26:43 -0700 Subject: [PATCH] Error message for inconnected primitive ports. Error message (instead of a seg fault) when a primitive port is left unconnected. Signed-off-by: Stephen Williams --- elaborate.cc | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/elaborate.cc b/elaborate.cc index 50734d53df..45d737ff73 100644 --- a/elaborate.cc +++ b/elaborate.cc @@ -469,6 +469,12 @@ void PGBuiltin::elaborate(Design*des, NetScope*scope) const for (unsigned idx = 0 ; idx < pin_count() ; idx += 1) { const PExpr*ex = pin(idx); + if (ex == 0) { + cerr << get_line() << ": error: Logic gate port " + "expressions are not optional." << endl; + des->errors += 1; + return; + } NetNet*sig = (idx == 0) ? ex->elaborate_lnet(des, scope, true) : ex->elaborate_net(des, scope, 0, 0, 0, 0);