arith.c (gfc_real2complex): Range checking wrong part of complex number.

2004-05-17  Steve Kargl  <kargls@comcast.net>

* arith.c (gfc_real2complex): Range checking wrong part of complex
        number.

From-SVN: r81957
This commit is contained in:
Steve Kargl 2004-05-17 23:19:47 +00:00 committed by Tobias Schlüter
parent b2342b5484
commit e876acbd25
2 changed files with 6 additions and 1 deletions

View File

@ -1,3 +1,8 @@
2004-05-17 Steve Kargl <kargls@comcast.net>
* arith.c (gfc_real2complex): Range checking wrong part of complex
number.
2004-05-16 Paul Brook <paul@codesourcery.com>
* options.c (gfc_handle_module_path_options): Fix buffer overrun.

View File

@ -2666,7 +2666,7 @@ gfc_real2complex (gfc_expr * src, int kind)
mpf_set (result->value.complex.r, src->value.real);
mpf_set_ui (result->value.complex.i, 0);
if ((rc = gfc_check_real_range (result->value.complex.i, kind)) != ARITH_OK)
if ((rc = gfc_check_real_range (result->value.complex.r, kind)) != ARITH_OK)
{
arith_error (rc, &src->ts, &result->ts, &src->where);
gfc_free_expr (result);