Fix null pointer dereference in debug output.
Don't display an elaborated for loop initial assignment if elaboration has failed. Also remove duplicated message.
This commit is contained in:
parent
560b9530fd
commit
ccf7c042c9
|
|
@ -4889,7 +4889,7 @@ NetProc* PForStatement::elaborate(Design*des, NetScope*scope) const
|
|||
sig->data_type(), sig->vector_width(),
|
||||
expr1_);
|
||||
|
||||
if (debug_elaborate) {
|
||||
if (debug_elaborate && initial_expr) {
|
||||
cerr << get_fileline() << ": debug: FOR initial assign: "
|
||||
<< sig->name() << " = " << *initial_expr << endl;
|
||||
}
|
||||
|
|
@ -4900,18 +4900,11 @@ NetProc* PForStatement::elaborate(Design*des, NetScope*scope) const
|
|||
reported so it's OK that the netlist is bogus. */
|
||||
NetProc*sub = statement_->elaborate(des, scope);
|
||||
|
||||
|
||||
/* Now elaborate the for_step statement. I really should do
|
||||
some error checking here to make sure the step statement
|
||||
really does step the variable. */
|
||||
if (debug_elaborate) {
|
||||
cerr << get_fileline() << ": debug: Elaborate for_step statement "
|
||||
<< sig->name() << " = " << *initial_expr << endl;
|
||||
}
|
||||
|
||||
NetProc*step = step_->elaborate(des, scope);
|
||||
|
||||
|
||||
/* Elaborate the condition expression. Try to evaluate it too,
|
||||
in case it is a constant. This is an interesting case
|
||||
worthy of a warning. */
|
||||
|
|
|
|||
Loading…
Reference in New Issue