From 3f73c9bb54253536b4dcbc53e1494e28aa80601c Mon Sep 17 00:00:00 2001 From: Nick Gasson Date: Fri, 1 Aug 2008 16:35:47 +0100 Subject: [PATCH] Make sure argument to unary - is signed --- tgt-vhdl/expr.cc | 1 + 1 file changed, 1 insertion(+) diff --git a/tgt-vhdl/expr.cc b/tgt-vhdl/expr.cc index c57f951a1..8de363b86 100644 --- a/tgt-vhdl/expr.cc +++ b/tgt-vhdl/expr.cc @@ -158,6 +158,7 @@ static vhdl_expr *translate_unary(ivl_expr_t e) return new vhdl_unaryop_expr (VHDL_UNARYOP_NOT, operand, new vhdl_type(*operand->get_type())); case '-': + operand = change_signedness(operand, true); return new vhdl_unaryop_expr (VHDL_UNARYOP_NEG, operand, new vhdl_type(*operand->get_type())); case 'N': // NOR