Always set current_symtab in class_init().

But reset current_symtab to its prior value when done. This fixes a
segfault caused by initializing the class system while parsing a struct
(eg, one of the members is of type id).
This commit is contained in:
Bill Currie 2012-12-22 20:06:14 +09:00
parent ff4b232d92
commit 1c76ccc425

View file

@ -1629,10 +1629,13 @@ class_init_obj_module (void)
void
class_init (void)
{
if (!current_symtab)
current_symtab = pr.symtab;
symtab_t *cs = current_symtab;
current_symtab = pr.symtab;
class_init_obj_module ();
init_classes ();
init_objective_structs ();
obj_initialized = 1;
current_symtab = cs;
}