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
This commit is contained in:
Andreas Schwab 1998-11-25 04:06:42 +00:00 committed by Andreas Schwab
parent 84e6233f15
commit 32201ce4ea
2 changed files with 10 additions and 7 deletions

View File

@ -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> 1998-11-24 Jason Merrill <jason@yorick.cygnus.com>
* decl.c (start_decl): An explicit specialization of a static data * decl.c (start_decl): An explicit specialization of a static data

View File

@ -4677,8 +4677,7 @@ make_lang_type (code)
if (IS_AGGR_TYPE_CODE (code)) if (IS_AGGR_TYPE_CODE (code))
{ {
struct obstack *obstack = current_obstack; struct obstack *obstack = current_obstack;
register int i = sizeof (struct lang_type) / sizeof (int); struct lang_type *pi;
register int *pi;
SET_IS_AGGR_TYPE (t, 1); SET_IS_AGGR_TYPE (t, 1);
@ -4687,11 +4686,10 @@ make_lang_type (code)
else else
my_friendly_assert (obstack == &permanent_obstack, 236); my_friendly_assert (obstack == &permanent_obstack, 236);
pi = (int *) obstack_alloc (obstack, sizeof (struct lang_type)); pi = (struct lang_type *) obstack_alloc (obstack, sizeof (struct lang_type));
while (i > 0) bzero ((char *) pi, (int) sizeof (struct lang_type));
pi[--i] = 0;
TYPE_LANG_SPECIFIC (t) = (struct lang_type *) pi; TYPE_LANG_SPECIFIC (t) = pi;
CLASSTYPE_AS_LIST (t) = build_expr_list (NULL_TREE, t); CLASSTYPE_AS_LIST (t) = build_expr_list (NULL_TREE, t);
SET_CLASSTYPE_INTERFACE_UNKNOWN_X (t, interface_unknown); SET_CLASSTYPE_INTERFACE_UNKNOWN_X (t, interface_unknown);
CLASSTYPE_INTERFACE_ONLY (t) = interface_only; CLASSTYPE_INTERFACE_ONLY (t) = interface_only;