From 1d410370097f4598cadf5e74cffb2528eefc9199 Mon Sep 17 00:00:00 2001 From: Larry Doolittle Date: Fri, 14 Nov 2008 15:43:49 -0800 Subject: [PATCH] Avoid crash with typo in varaible name A simple typo in the rhs of an expression would crash the compiler. Example: module crash3; reg clk; integer cnt1=0; always @(posedge clk) begin cnt1 <= (cnt==81) ? 0 : (cnt1+1); end endmodule --- elaborate.cc | 1 + 1 file changed, 1 insertion(+) diff --git a/elaborate.cc b/elaborate.cc index 6875ed8e9..9dd330ab5 100644 --- a/elaborate.cc +++ b/elaborate.cc @@ -2037,6 +2037,7 @@ NetProc* PAssignNB::elaborate(Design*des, NetScope*scope) const if (lv == 0) return 0; NetExpr*rv = elaborate_rval_(des, scope, count_lval_width(lv), lv->expr_type()); + if (rv == 0) return 0; /* Handle the (common) case that the r-value is a vector. This includes just about everything but reals. In this case, we