undef object must not appear in the user land
This commit is contained in:
parent
ff646e05dd
commit
9b7fdb0725
|
@ -6,7 +6,6 @@ enum pic_instruction {
|
||||||
OP_PUSHTRUE,
|
OP_PUSHTRUE,
|
||||||
OP_PUSHFALSE,
|
OP_PUSHFALSE,
|
||||||
OP_PUSHNUM,
|
OP_PUSHNUM,
|
||||||
OP_PUSHUNDEF,
|
|
||||||
OP_GREF,
|
OP_GREF,
|
||||||
OP_GSET,
|
OP_GSET,
|
||||||
OP_CALL,
|
OP_CALL,
|
||||||
|
|
|
@ -46,14 +46,14 @@ pic_port_write(pic_state *pic)
|
||||||
|
|
||||||
pic_get_args(pic, "o", &v);
|
pic_get_args(pic, "o", &v);
|
||||||
pic_debug(pic, v);
|
pic_debug(pic, v);
|
||||||
return pic_undef_value();
|
return pic_false_value();
|
||||||
}
|
}
|
||||||
|
|
||||||
static pic_value
|
static pic_value
|
||||||
pic_port_newline(pic_state *pic)
|
pic_port_newline(pic_state *pic)
|
||||||
{
|
{
|
||||||
puts("");
|
puts("");
|
||||||
return pic_undef_value();
|
return pic_false_value();
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
|
|
14
src/vm.c
14
src/vm.c
|
@ -119,9 +119,6 @@ print_irep(pic_state *pic, struct pic_irep *irep)
|
||||||
case OP_PUSHNUM:
|
case OP_PUSHNUM:
|
||||||
printf("OP_PUSHNUM\t%g\n", irep->code[i].u.f);
|
printf("OP_PUSHNUM\t%g\n", irep->code[i].u.f);
|
||||||
break;
|
break;
|
||||||
case OP_PUSHUNDEF:
|
|
||||||
puts("OP_PUSHUNDEF");
|
|
||||||
break;
|
|
||||||
case OP_GREF:
|
case OP_GREF:
|
||||||
printf("OP_GREF\t%p\n", irep->code[i].u.gvar);
|
printf("OP_GREF\t%p\n", irep->code[i].u.gvar);
|
||||||
break;
|
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].insn = OP_GSET;
|
||||||
irep->code[irep->clen].u.gvar = gvar;
|
irep->code[irep->clen].u.gvar = gvar;
|
||||||
irep->clen++;
|
irep->clen++;
|
||||||
irep->code[irep->clen].insn = OP_PUSHUNDEF;
|
irep->code[irep->clen].insn = OP_PUSHFALSE;
|
||||||
irep->clen++;
|
irep->clen++;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
@ -286,11 +283,6 @@ pic_gen(pic_state *pic, struct pic_irep *irep, pic_value obj, struct pic_env *en
|
||||||
irep->clen++;
|
irep->clen++;
|
||||||
break;
|
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));
|
PUSH(pic_float_value(pc->u.f));
|
||||||
NEXT;
|
NEXT;
|
||||||
}
|
}
|
||||||
CASE(OP_PUSHUNDEF) {
|
|
||||||
PUSH(pic_undef_value());
|
|
||||||
NEXT;
|
|
||||||
}
|
|
||||||
CASE(OP_GREF) {
|
CASE(OP_GREF) {
|
||||||
PUSH(pc->u.gvar->cdr);
|
PUSH(pc->u.gvar->cdr);
|
||||||
NEXT;
|
NEXT;
|
||||||
|
|
Loading…
Reference in New Issue