Fix crash when `if' statement had no `else'

This commit is contained in:
Nick Gasson 2008-06-16 12:13:01 +01:00
parent 8a9486eb49
commit 92c823680a
1 changed files with 4 additions and 2 deletions

View File

@ -388,8 +388,10 @@ static int draw_if(vhdl_process *proc, stmt_container *container,
draw_stmt(proc, vhdif->get_then_container(),
ivl_stmt_cond_true(stmt));
draw_stmt(proc, vhdif->get_else_container(),
ivl_stmt_cond_false(stmt));
ivl_statement_t cond_false_stmt = ivl_stmt_cond_false(stmt);
if (cond_false_stmt)
draw_stmt(proc, vhdif->get_else_container(), cond_false_stmt);
container->add_stmt(vhdif);