fix some bugs

This commit is contained in:
Yuichi Nishiwaki 2014-01-18 22:36:02 -08:00
parent 14eb6b334d
commit 6dcf04d50c
1 changed files with 5 additions and 2 deletions

View File

@ -160,7 +160,8 @@ push_scope(analyze_state *state, pic_value args)
scope->local_tbl = x = xh_new(); scope->local_tbl = x = xh_new();
scope->varg = false; scope->varg = false;
i = 1; l = 0; i = 1;
l = 0;
for (v = args; pic_pair_p(v); v = pic_cdr(pic, v)) { for (v = args; pic_pair_p(v); v = pic_cdr(pic, v)) {
pic_value sym; pic_value sym;
@ -180,6 +181,8 @@ push_scope(analyze_state *state, pic_value args)
scope->argc = i; scope->argc = i;
scope->localc = l; scope->localc = l;
scope->dirty_flags = (int *)pic_calloc(pic, i + l, sizeof(int)); scope->dirty_flags = (int *)pic_calloc(pic, i + l, sizeof(int));
state->scope = scope;
} }
static void static void
@ -627,7 +630,7 @@ analyze_call(analyze_state *state, pic_value obj, bool tailpos)
call = state->sTAILCALL; call = state->sTAILCALL;
} }
seq = pic_list(pic, 1, pic_symbol_value(call)); seq = pic_list(pic, 1, pic_symbol_value(call));
for (; ! pic_nil_p(seq); obj = pic_cdr(pic, obj)) { for (; ! pic_nil_p(obj); obj = pic_cdr(pic, obj)) {
seq = pic_cons(pic, analyze(state, pic_car(pic, obj), false), seq); seq = pic_cons(pic, analyze(state, pic_car(pic, obj), false), seq);
} }
seq = pic_reverse(pic, seq); seq = pic_reverse(pic, seq);