public inbox for gcc-prs@sourceware.org
help / color / mirror / Atom feed
From: zhenggen@public1.ptt.js.cn
To: gcc-gnats@gcc.gnu.org
Subject: ada/5978: A short-circuit return statement should be added to a-ngcefu.adb
Date: Fri, 15 Mar 2002 18:56:00 -0000	[thread overview]
Message-ID: <20020316024953.14916.qmail@sources.redhat.com> (raw)


>Number:         5978
>Category:       ada
>Synopsis:       A short-circuit return statement should be added to a-ngcefu.adb
>Confidential:   no
>Severity:       serious
>Priority:       medium
>Responsible:    unassigned
>State:          open
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Fri Mar 15 18:56:00 PST 2002
>Closed-Date:
>Last-Modified:
>Originator:     zhenggen@public1.ptt.js.cn
>Release:        any
>Organization:
>Environment:
any
>Description:
Code fragment in gcc/gcc/ada/a-ngcefu.adb:

line309:      if abs Re (X) < Square_Root_Epsilon and then
line310:         abs Im (X) < Square_Root_Epsilon
line311:      then
line312:         return X;
line313:
line314:      elsif abs Re (X) > Inv_Square_Root_Epsilon or else
line315:            abs Im (X) > Inv_Square_Root_Epsilon
line316:      then
line317:         Result := -Complex_I * (Log (Complex_I * X) + Log (2.0 * Complex_I));
line318:
line319:         if Im (Result) > PI_2 then
line320:            Set_Im (Result, PI - Im (X));
line321:
line322:         elsif Im (Result) < -PI_2 then
line323:            Set_Im (Result, -(PI + Im (X)));
line324:         end if;
line325:      end if;
line326:
line327:      Result := -Complex_I * Log (Complex_I * X + Sqrt (1.0 - X * X));

A short-circuit statement "return Result;" should be placed between
line324 and line325. Otherwise the assignment in line327 will
modify the value of "Result".
>How-To-Repeat:

>Fix:
Place a statement "Return Result;" between line324 and line325
in gcc/gcc/ada/a-ngcefu.adb
>Release-Note:
>Audit-Trail:
>Unformatted:


             reply	other threads:[~2002-03-16  2:56 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2002-03-15 18:56 zhenggen [this message]
2003-05-10 21:36 Dara Hazeghi
2003-05-12 11:16 giovannibajo
2003-05-12 16:16 Dara Hazeghi
2003-05-14 10:34 giovannibajo

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20020316024953.14916.qmail@sources.redhat.com \
    --to=zhenggen@public1.ptt.js.cn \
    --cc=gcc-gnats@gcc.gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).