]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
re PR c++/18370 (cp_parser_initializer_list uninit variable problems)
authorJ"orn Rennecke <joern.rennecke@st.com>
Thu, 27 Jan 2005 12:57:41 +0000 (12:57 +0000)
committerJoern Rennecke <amylaar@gcc.gnu.org>
Thu, 27 Jan 2005 12:57:41 +0000 (12:57 +0000)
gcc:
* real.c (do_add): Initialize signalling and canonical members.

* real.c (real_from_integer): Zero out destination.
gcc/cp:
PR c++/18370
* parser.c (cp_parser_initializer_clause): Initialize *non_constant_p.

From-SVN: r94322

gcc/ChangeLog
gcc/cp/ChangeLog
gcc/cp/parser.c
gcc/real.c

index b489880b9025474a06dfe5a241a5abd35d74fc77..3ca24a7ab3585b18316bae5a5323d02fa8ffbe8c 100644 (file)
@@ -1,3 +1,9 @@
+2005-01-27  J"orn Rennecke <joern.rennecke@st.com>
+
+       * real.c (do_add): Initialize signalling and canonical members.
+
+       * real.c (real_from_integer): Zero out destination.
+
 2005-01-26  Ulrich Weigand  <uweigand@de.ibm.com>
 
        Backport from mainline:
index 0103228ee0038bf0a736ca54e27a66c39b7d4db5..869878c9d154090ed8ea2886e7e98cbd63fe9527 100644 (file)
@@ -1,3 +1,8 @@
+2005-01-27  J"orn Rennecke <joern.rennecke@st.com>
+
+       PR c++/18370
+       * parser.c (cp_parser_initializer_clause): Initialize *non_constant_p.
+
 2005-01-19  Kriang Lerdsuwanakij  <lerdsuwa@users.sourceforge.net>
 
        PR c++/19375
index 1bde1f9830b7a5d8df07c6b7b2be63db16c43677..46d6bbf157f4ef2f8a5c0b769a6ef9f361b7a69a 100644 (file)
@@ -11543,6 +11543,9 @@ cp_parser_initializer_clause (cp_parser* parser, bool* non_constant_p)
 {
   tree initializer = NULL_TREE;
 
+  /* Assume the expression is constant.  */
+  *non_constant_p = false;
+
   /* If it is not a `{', then we are looking at an
      assignment-expression.  */
   if (cp_lexer_next_token_is_not (parser->lexer, CPP_OPEN_BRACE))
index 11927ee59cf88e3a11025d9eb0a8e6e03f2555ca..843725e55909ee568581f5fbdfaef4c9f8159a8c 100644 (file)
@@ -640,6 +640,9 @@ do_add (REAL_VALUE_TYPE *r, const REAL_VALUE_TYPE *a,
   r->class = rvc_normal;
   r->sign = sign;
   r->exp = exp;
+  /* Zero out the remaining fields.  */
+  r->signalling = 0;
+  r->canonical = 0;
 
   /* Re-normalize the result.  */
   normalize (r);
@@ -1960,6 +1963,7 @@ real_from_integer (REAL_VALUE_TYPE *r, enum machine_mode mode,
     get_zero (r, 0);
   else
     {
+      memset (r, 0, sizeof (*r));
       r->class = rvc_normal;
       r->sign = high < 0 && !unsigned_p;
       r->exp = 2 * HOST_BITS_PER_WIDE_INT;
@@ -1977,7 +1981,6 @@ real_from_integer (REAL_VALUE_TYPE *r, enum machine_mode mode,
        {
          r->sig[SIGSZ-1] = high;
          r->sig[SIGSZ-2] = low;
-         memset (r->sig, 0, sizeof(long)*(SIGSZ-2));
        }
       else if (HOST_BITS_PER_LONG*2 == HOST_BITS_PER_WIDE_INT)
        {
@@ -1985,8 +1988,6 @@ real_from_integer (REAL_VALUE_TYPE *r, enum machine_mode mode,
          r->sig[SIGSZ-2] = high;
          r->sig[SIGSZ-3] = low >> (HOST_BITS_PER_LONG - 1) >> 1;
          r->sig[SIGSZ-4] = low;
-         if (SIGSZ > 4)
-           memset (r->sig, 0, sizeof(long)*(SIGSZ-4));
        }
       else
        abort ();