aboutsummaryrefslogtreecommitdiff
path: root/gcc
diff options
context:
space:
mode:
authorAndreas Schwab <schwab@issan.cs.uni-dortmund.de>1998-11-25 04:06:42 +0000
committerAndreas Schwab <schwab@gcc.gnu.org>1998-11-25 04:06:42 +0000
commit32201ce4ea04e55691947bac2a4e9247a6a9e71e (patch)
tree86a64554c807b55d5fdea1aeebaa1f8bc41fdb0e /gcc
parent84e6233f15d47c617c868750ca27adf2e772126d (diff)
downloadgcc-32201ce4ea04e55691947bac2a4e9247a6a9e71e.zip
gcc-32201ce4ea04e55691947bac2a4e9247a6a9e71e.tar.gz
gcc-32201ce4ea04e55691947bac2a4e9247a6a9e71e.tar.bz2
lex.c (make_lang_type): Clear the whole struct lang_type, not only the first multiple of sizeof (int).
* lex.c (make_lang_type): Clear the whole struct lang_type, not only the first multiple of sizeof (int). From-SVN: r23848
Diffstat (limited to 'gcc')
-rw-r--r--gcc/cp/ChangeLog5
-rw-r--r--gcc/cp/lex.c12
2 files changed, 10 insertions, 7 deletions
diff --git a/gcc/cp/ChangeLog b/gcc/cp/ChangeLog
index 94d8d3a..940d106 100644
--- a/gcc/cp/ChangeLog
+++ b/gcc/cp/ChangeLog
@@ -1,3 +1,8 @@
+1998-11-25 Andreas Schwab <schwab@issan.cs.uni-dortmund.de>
+
+ * lex.c (make_lang_type): Clear the whole struct lang_type, not
+ only the first multiple of sizeof (int).
+
1998-11-24 Jason Merrill <jason@yorick.cygnus.com>
* decl.c (start_decl): An explicit specialization of a static data
diff --git a/gcc/cp/lex.c b/gcc/cp/lex.c
index 461f73e..5d9fc80 100644
--- a/gcc/cp/lex.c
+++ b/gcc/cp/lex.c
@@ -4677,9 +4677,8 @@ make_lang_type (code)
if (IS_AGGR_TYPE_CODE (code))
{
struct obstack *obstack = current_obstack;
- register int i = sizeof (struct lang_type) / sizeof (int);
- register int *pi;
-
+ struct lang_type *pi;
+
SET_IS_AGGR_TYPE (t, 1);
if (! TREE_PERMANENT (t))
@@ -4687,11 +4686,10 @@ make_lang_type (code)
else
my_friendly_assert (obstack == &permanent_obstack, 236);
- pi = (int *) obstack_alloc (obstack, sizeof (struct lang_type));
- while (i > 0)
- pi[--i] = 0;
+ pi = (struct lang_type *) obstack_alloc (obstack, sizeof (struct lang_type));
+ bzero ((char *) pi, (int) sizeof (struct lang_type));
- TYPE_LANG_SPECIFIC (t) = (struct lang_type *) pi;
+ TYPE_LANG_SPECIFIC (t) = pi;
CLASSTYPE_AS_LIST (t) = build_expr_list (NULL_TREE, t);
SET_CLASSTYPE_INTERFACE_UNKNOWN_X (t, interface_unknown);
CLASSTYPE_INTERFACE_ONLY (t) = interface_only;