diff options
author | parsons <parsons@ae88bc3d-4319-0410-8dbf-d08b4c9d3795> | 2003-07-12 16:16:38 +0000 |
---|---|---|
committer | parsons <parsons@ae88bc3d-4319-0410-8dbf-d08b4c9d3795> | 2003-07-12 16:16:38 +0000 |
commit | 1911c5afa6cd23dacfa934d0a4463593a3f8fbeb (patch) | |
tree | de4e1eaf2162f8fd1797a90e69986a5273564a02 /TAO | |
parent | 29216fa0ee15cdb4b07ab77c3fff7f3fa96163bf (diff) | |
download | ATCD-1911c5afa6cd23dacfa934d0a4463593a3f8fbeb.tar.gz |
ChangelogTag: Sat Jul 12 11:08:41 2003 Jeff Parsons <j.parsons@vanderbilt.edu>
Diffstat (limited to 'TAO')
-rw-r--r-- | TAO/ChangeLog | 11 | ||||
-rw-r--r-- | TAO/TAO_IDL/ast/ast_constant.cpp | 8 |
2 files changed, 17 insertions, 2 deletions
diff --git a/TAO/ChangeLog b/TAO/ChangeLog index 2fec89d1201..9f1b18e9bd8 100644 --- a/TAO/ChangeLog +++ b/TAO/ChangeLog @@ -1,3 +1,14 @@ +Sat Jul 12 11:08:41 2003 Jeff Parsons <j.parsons@vanderbilt.edu> + + * TAO_IDL/ast/ast_constant.cpp: + + To a previous fix to prevent a truncation error on MSVC when + assigning a float constant from a literal in the constructor, added + an additional check to make sure we are not assigning from + another float constant, or from a literal decimal coerced to a + float. Thanks to Erik Johannes <erik_posting_email@yahoo.com> for + reporting the problem assigning one float constant to another. + Fri Jul 11 18:41:41 2003 Jeff Parsons <j.parsons@vanderbilt.edu> * tao/Any.cpp: diff --git a/TAO/TAO_IDL/ast/ast_constant.cpp b/TAO/TAO_IDL/ast/ast_constant.cpp index c6e55bf1f08..029bc77859b 100644 --- a/TAO/TAO_IDL/ast/ast_constant.cpp +++ b/TAO/TAO_IDL/ast/ast_constant.cpp @@ -164,8 +164,12 @@ AST_Constant::AST_Constant (AST_Expression::ExprType t, ifr_added_ (0) { // Avoids a truncation warning on MSVC when assigning a decimal - // literal to a float constant. - if (t == AST_Expression::EV_float) + // literal to a float constant. Must also check that the input + // expression is of type double (indicates that we are being + // assigned from a literal). If v is of type float, it may be + // a constant-to-constant assignment - in any case the danger + // of truncation would not apply. + if (t == AST_Expression::EV_float && v->ev ()->et == AST_Expression::EV_double) { AST_Expression::AST_ExprValue *ev = this->pd_constant_value->ev (); |