diff options
Diffstat (limited to 'TAO/TAO_IDL/ast/ast_expression.cpp')
-rw-r--r-- | TAO/TAO_IDL/ast/ast_expression.cpp | 15 |
1 files changed, 6 insertions, 9 deletions
diff --git a/TAO/TAO_IDL/ast/ast_expression.cpp b/TAO/TAO_IDL/ast/ast_expression.cpp index 3a57e842b2a..e3614c509bd 100644 --- a/TAO/TAO_IDL/ast/ast_expression.cpp +++ b/TAO/TAO_IDL/ast/ast_expression.cpp @@ -1433,28 +1433,25 @@ AST_Expression::eval_un_op(AST_Expression::EvalKind ek) pd_v1->set_ev(pd_v1->eval_internal(ek)); if (pd_v1->ev() == NULL) return NULL; + pd_v1->set_ev(pd_v1->coerce(EV_double)); + if (pd_v1->ev() == NULL) + return NULL; retval = new AST_ExprValue; retval->et = EV_double; switch (pd_ec) { case EC_u_plus: - pd_v1->set_ev(pd_v1->coerce(EV_double)); - if (pd_v1->ev() == NULL) - return NULL; - retval->u.dval = pd_v1->ev()->u.dval; + retval->u.lval = pd_v1->ev()->u.lval; break; case EC_u_minus: - pd_v1->set_ev(pd_v1->coerce(EV_double)); - if (pd_v1->ev() == NULL) - return NULL; - retval->u.dval = -(pd_v1->ev()->u.dval); + retval->u.lval = -(pd_v1->ev()->u.lval); break; case EC_bit_neg: pd_v1->set_ev(pd_v1->coerce(EV_long)); if (pd_v1->ev() == NULL) return NULL; - retval->u.dval = ~pd_v1->ev()->u.lval; + retval->u.lval = ~pd_v1->ev()->u.lval; break; default: return NULL; |