From 79558910d1c9f3c55f06f8ebd4bb9eb303b9817f Mon Sep 17 00:00:00 2001 From: Nick Gasson Date: Sat, 7 Jun 2008 16:44:01 +0100 Subject: [PATCH] Catch case where NULL return wasn't detected --- tgt-vhdl/stmt.cc | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/tgt-vhdl/stmt.cc b/tgt-vhdl/stmt.cc index fb4e071fc..9d4fa789a 100644 --- a/tgt-vhdl/stmt.cc +++ b/tgt-vhdl/stmt.cc @@ -166,11 +166,11 @@ static int draw_nbassign(vhdl_process *proc, ivl_statement_t stmt) vhdl_decl *decl = proc->get_parent()->get_decl(signame); assert(decl); - - vhdl_expr *rhs = - decl->get_type()->cast(translate_expr(ivl_stmt_rval(stmt))); - if (NULL == rhs) + + vhdl_expr *rhs_raw = translate_expr(ivl_stmt_rval(stmt)); + if (NULL == rhs_raw) return 1; + vhdl_expr *rhs = decl->get_type()->cast(rhs_raw); // The type here can be null as it is never actually needed vhdl_var_ref *lval_ref = new vhdl_var_ref(signame, NULL);