Make sure argument to unary - is signed

This commit is contained in:
Nick Gasson 2008-08-01 16:35:47 +01:00
parent 09f3eb4a36
commit 3f73c9bb54
1 changed files with 1 additions and 0 deletions

View File

@ -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