From a9c98ad5f264b8ce1803584d2c7c5a8531d18bcd Mon Sep 17 00:00:00 2001 From: Nick Gasson Date: Tue, 15 Jul 2008 14:26:19 +0100 Subject: [PATCH] Handle `if' with empty cond_true part Fixes assertion failure with following statement: if (foo) begin end else ... --- tgt-vhdl/stmt.cc | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/tgt-vhdl/stmt.cc b/tgt-vhdl/stmt.cc index 106d1a24d..dfdd59263 100644 --- a/tgt-vhdl/stmt.cc +++ b/tgt-vhdl/stmt.cc @@ -436,8 +436,9 @@ static int draw_if(vhdl_procedural *proc, stmt_container *container, vhdl_if_stmt *vhdif = new vhdl_if_stmt(test); - draw_stmt(proc, vhdif->get_then_container(), - ivl_stmt_cond_true(stmt)); + ivl_statement_t cond_true_stmt = ivl_stmt_cond_true(stmt); + if (cond_true_stmt) + draw_stmt(proc, vhdif->get_then_container(), cond_true_stmt); ivl_statement_t cond_false_stmt = ivl_stmt_cond_false(stmt); if (cond_false_stmt)