Commit e9f69069 by Patrick Palka

Fix cp_binding_level reuse logic

gcc/cp/ChangeLog:

	* name-lookup.c (begin_scope): After reusing a cp_binding_level
	structure, update free_binding_level before the structure's
	level_chain field gets cleared, not after.

From-SVN: r232965
parent 3a7d8a85
2016-01-29 Patrick Palka <ppalka@gcc.gnu.org>
* name-lookup.c (begin_scope): After reusing a cp_binding_level
structure, update free_binding_level before the structure's
level_chain field gets cleared, not after.
2016-01-28 Jason Merrill <jason@redhat.com>
PR c++/67407
......
......@@ -1557,8 +1557,8 @@ begin_scope (scope_kind kind, tree entity)
if (!ENABLE_SCOPE_CHECKING && free_binding_level)
{
scope = free_binding_level;
memset (scope, 0, sizeof (cp_binding_level));
free_binding_level = scope->level_chain;
memset (scope, 0, sizeof (cp_binding_level));
}
else
scope = ggc_cleared_alloc<cp_binding_level> ();
......
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