Skip to content

Commit

Permalink
Avoid crash with typo in varaible name
Browse files Browse the repository at this point in the history
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
  • Loading branch information
ldoolitt authored and steveicarus committed Nov 15, 2008
1 parent 574c8a8 commit 1d41037
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions elaborate.cc
Expand Up @@ -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
Expand Down

0 comments on commit 1d41037

Please sign in to comment.