undef object must not appear in the user land

This commit is contained in:
Yuichi Nishiwaki 2013-10-16 13:24:08 +09:00
parent ff646e05dd
commit 9b7fdb0725
3 changed files with 3 additions and 16 deletions

View File

@ -6,7 +6,6 @@ enum pic_instruction {
OP_PUSHTRUE,
OP_PUSHFALSE,
OP_PUSHNUM,
OP_PUSHUNDEF,
OP_GREF,
OP_GSET,
OP_CALL,

View File

@ -46,14 +46,14 @@ pic_port_write(pic_state *pic)
pic_get_args(pic, "o", &v);
pic_debug(pic, v);
return pic_undef_value();
return pic_false_value();
}
static pic_value
pic_port_newline(pic_state *pic)
{
puts("");
return pic_undef_value();
return pic_false_value();
}
void

View File

@ -119,9 +119,6 @@ print_irep(pic_state *pic, struct pic_irep *irep)
case OP_PUSHNUM:
printf("OP_PUSHNUM\t%g\n", irep->code[i].u.f);
break;
case OP_PUSHUNDEF:
puts("OP_PUSHUNDEF");
break;
case OP_GREF:
printf("OP_GREF\t%p\n", irep->code[i].u.gvar);
break;
@ -213,7 +210,7 @@ pic_gen(pic_state *pic, struct pic_irep *irep, pic_value obj, struct pic_env *en
irep->code[irep->clen].insn = OP_GSET;
irep->code[irep->clen].u.gvar = gvar;
irep->clen++;
irep->code[irep->clen].insn = OP_PUSHUNDEF;
irep->code[irep->clen].insn = OP_PUSHFALSE;
irep->clen++;
break;
}
@ -286,11 +283,6 @@ pic_gen(pic_state *pic, struct pic_irep *irep, pic_value obj, struct pic_env *en
irep->clen++;
break;
}
case PIC_TT_UNDEF: {
irep->code[irep->clen].insn = OP_PUSHUNDEF;
irep->clen++;
break;
}
}
}
@ -408,10 +400,6 @@ pic_run(pic_state *pic, struct pic_proc *proc, pic_value args)
PUSH(pic_float_value(pc->u.f));
NEXT;
}
CASE(OP_PUSHUNDEF) {
PUSH(pic_undef_value());
NEXT;
}
CASE(OP_GREF) {
PUSH(pc->u.gvar->cdr);
NEXT;