add missing returns
This commit is contained in:
parent
a35606dc16
commit
f3e2321679
|
@ -813,7 +813,7 @@ codegen(codegen_state *state, pic_value obj)
|
||||||
cxt->code[cxt->clen].u.r.idx = pic_int(pic_list_ref(pic, obj, 2));
|
cxt->code[cxt->clen].u.r.idx = pic_int(pic_list_ref(pic, obj, 2));
|
||||||
cxt->clen++;
|
cxt->clen++;
|
||||||
return;
|
return;
|
||||||
} else if (sym == state-> sLREF) {
|
} else if (sym == state->sLREF) {
|
||||||
cxt->code[cxt->clen].insn = OP_LREF;
|
cxt->code[cxt->clen].insn = OP_LREF;
|
||||||
cxt->code[cxt->clen].u.i = pic_int(pic_list_ref(pic, obj, 1));
|
cxt->code[cxt->clen].u.i = pic_int(pic_list_ref(pic, obj, 1));
|
||||||
cxt->clen++;
|
cxt->clen++;
|
||||||
|
@ -1003,30 +1003,35 @@ codegen(codegen_state *state, pic_value obj)
|
||||||
codegen(state, pic_list_ref(pic, obj, 2));
|
codegen(state, pic_list_ref(pic, obj, 2));
|
||||||
cxt->code[cxt->clen].insn = OP_EQ;
|
cxt->code[cxt->clen].insn = OP_EQ;
|
||||||
cxt->clen++;
|
cxt->clen++;
|
||||||
|
return;
|
||||||
}
|
}
|
||||||
else if (sym == pic->sLT) {
|
else if (sym == pic->sLT) {
|
||||||
codegen(state, pic_list_ref(pic, obj, 1));
|
codegen(state, pic_list_ref(pic, obj, 1));
|
||||||
codegen(state, pic_list_ref(pic, obj, 2));
|
codegen(state, pic_list_ref(pic, obj, 2));
|
||||||
cxt->code[cxt->clen].insn = OP_LT;
|
cxt->code[cxt->clen].insn = OP_LT;
|
||||||
cxt->clen++;
|
cxt->clen++;
|
||||||
|
return;
|
||||||
}
|
}
|
||||||
else if (sym == pic->sLE) {
|
else if (sym == pic->sLE) {
|
||||||
codegen(state, pic_list_ref(pic, obj, 1));
|
codegen(state, pic_list_ref(pic, obj, 1));
|
||||||
codegen(state, pic_list_ref(pic, obj, 2));
|
codegen(state, pic_list_ref(pic, obj, 2));
|
||||||
cxt->code[cxt->clen].insn = OP_LE;
|
cxt->code[cxt->clen].insn = OP_LE;
|
||||||
cxt->clen++;
|
cxt->clen++;
|
||||||
|
return;
|
||||||
}
|
}
|
||||||
else if (sym == pic->sGT) {
|
else if (sym == pic->sGT) {
|
||||||
codegen(state, pic_list_ref(pic, obj, 2));
|
codegen(state, pic_list_ref(pic, obj, 2));
|
||||||
codegen(state, pic_list_ref(pic, obj, 1));
|
codegen(state, pic_list_ref(pic, obj, 1));
|
||||||
cxt->code[cxt->clen].insn = OP_LT;
|
cxt->code[cxt->clen].insn = OP_LT;
|
||||||
cxt->clen++;
|
cxt->clen++;
|
||||||
|
return;
|
||||||
}
|
}
|
||||||
else if (sym == pic->sGE) {
|
else if (sym == pic->sGE) {
|
||||||
codegen(state, pic_list_ref(pic, obj, 2));
|
codegen(state, pic_list_ref(pic, obj, 2));
|
||||||
codegen(state, pic_list_ref(pic, obj, 1));
|
codegen(state, pic_list_ref(pic, obj, 1));
|
||||||
cxt->code[cxt->clen].insn = OP_LE;
|
cxt->code[cxt->clen].insn = OP_LE;
|
||||||
cxt->clen++;
|
cxt->clen++;
|
||||||
|
return;
|
||||||
}
|
}
|
||||||
else if (sym == state->sCALL || sym == state->sTAILCALL) {
|
else if (sym == state->sCALL || sym == state->sTAILCALL) {
|
||||||
int len = pic_length(pic, obj);
|
int len = pic_length(pic, obj);
|
||||||
|
@ -1036,6 +1041,7 @@ codegen(codegen_state *state, pic_value obj)
|
||||||
cxt->code[cxt->clen].insn = (sym == state->sCALL) ? OP_CALL : OP_TAILCALL;
|
cxt->code[cxt->clen].insn = (sym == state->sCALL) ? OP_CALL : OP_TAILCALL;
|
||||||
cxt->code[cxt->clen].u.i = len;
|
cxt->code[cxt->clen].u.i = len;
|
||||||
cxt->clen++;
|
cxt->clen++;
|
||||||
|
return;
|
||||||
}
|
}
|
||||||
pic_error(pic, "codegen: unknown AST type");
|
pic_error(pic, "codegen: unknown AST type");
|
||||||
}
|
}
|
||||||
|
@ -1061,8 +1067,6 @@ codegen_lambda(codegen_state *state, pic_value obj)
|
||||||
return pop_codegen_context(state);
|
return pop_codegen_context(state);
|
||||||
}
|
}
|
||||||
|
|
||||||
pic_value pic_analyze(pic_state *, pic_value);
|
|
||||||
|
|
||||||
struct pic_irep *
|
struct pic_irep *
|
||||||
pic_codegen(pic_state *pic, pic_value obj)
|
pic_codegen(pic_state *pic, pic_value obj)
|
||||||
{
|
{
|
||||||
|
|
Loading…
Reference in New Issue