Blob Blame History Raw
From aed9d68b2a7e6622a7d0037d25d69d486a33825c Mon Sep 17 00:00:00 2001
From: Marek Polacek <polacek@redhat.com>
Date: Thu, 8 Oct 2020 16:27:55 -0400
Subject: [PATCH] Fix reading uninitialized value.  Remove dead assignment.

	* src/atan.c (mpc_atan): Initialize OK to zero.
	* src/pow.c (mpc_pow): Remove dead assignment.
---
 src/atan.c | 2 +-
 src/pow.c  | 1 -
 2 files changed, 1 insertion(+), 2 deletions(-)

diff --git a/src/atan.c b/src/atan.c
index cc1922b..4e71f6f 100644
--- a/src/atan.c
+++ b/src/atan.c
@@ -143,7 +143,7 @@ mpc_atan (mpc_ptr rop, mpc_srcptr op, mpc_rnd_t rnd)
           mpfr_rnd_t rnd_im, rnd_away;
           mpfr_t y, z;
           mpfr_prec_t p, p_im;
-          int ok;
+          int ok = 0;
 
           rnd_im = MPC_RND_IM (rnd);
           mpfr_init (y);
diff --git a/src/pow.c b/src/pow.c
index 4fc90ae..0fc6932 100644
--- a/src/pow.c
+++ b/src/pow.c
@@ -685,7 +685,6 @@ mpc_pow (mpc_ptr z, mpc_srcptr x, mpc_sr
          int inex_re, inex_im;
          /* under- and overflow flags are set by mpc_exp */
          mpc_set (z, u, MPC_RNDNN);
-         ret = ret_exp;
          inex_re = MPC_INEX_RE(ret_exp);
          inex_im = MPC_INEX_IM(ret_exp);
          if (mpfr_inf_p (mpc_realref (z)))