gc resolver

This commit is contained in:
Yuichi Nishiwaki 2014-01-27 21:17:24 +09:00
parent 244ec06953
commit 52927ac452
1 changed files with 14 additions and 0 deletions

View File

@ -816,8 +816,22 @@ resolve_cref(resolver_state *state, int depth, pic_sym sym)
pic_int_value(i));
}
static pic_value resolve_reference_node(resolver_state *state, pic_value obj);
static pic_value
resolve_reference(resolver_state *state, pic_value obj)
{
int ai = pic_gc_arena_preserve(state->pic);
obj = resolve_reference_node(state, obj);
pic_gc_arena_restore(state->pic, ai);
pic_gc_protect(state->pic, obj);
return obj;
}
static pic_value
resolve_reference_node(resolver_state *state, pic_value obj)
{
pic_state *pic = state->pic;
resolver_scope *scope = state->scope;