Commit 90b5a681 by Richard Kenner

(c_build_type_variant): Allocate new type in same obstack as old one.

From-SVN: r5278
parent e3a12f0c
...@@ -1194,16 +1194,13 @@ c_build_type_variant (type, constp, volatilep) ...@@ -1194,16 +1194,13 @@ c_build_type_variant (type, constp, volatilep)
if (TREE_CODE (type) == ARRAY_TYPE) if (TREE_CODE (type) == ARRAY_TYPE)
{ {
tree real_main_variant = TYPE_MAIN_VARIANT (type); tree real_main_variant = TYPE_MAIN_VARIANT (type);
int permanent = TREE_PERMANENT (type);
if (permanent) push_obstacks (TYPE_OBSTACK (type), TYPE_OBSTACK (type));
push_obstacks (&permanent_obstack, &permanent_obstack);
type = build_array_type (c_build_type_variant (TREE_TYPE (type), type = build_array_type (c_build_type_variant (TREE_TYPE (type),
constp, volatilep), constp, volatilep),
TYPE_DOMAIN (type)); TYPE_DOMAIN (type));
TYPE_MAIN_VARIANT (type) = real_main_variant; TYPE_MAIN_VARIANT (type) = real_main_variant;
if (permanent) pop_obstacks ();
pop_obstacks ();
} }
return build_type_variant (type, constp, volatilep); return build_type_variant (type, constp, volatilep);
} }
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment