This commit is contained in:
Yuichi Nishiwaki 2014-03-24 15:15:08 +09:00
parent af80ba6b36
commit 9dcdc45ab6
1 changed files with 3 additions and 8 deletions

View File

@ -914,15 +914,12 @@ pic_apply(pic_state *pic, struct pic_proc *proc, pic_value argv)
DEFINE_COMP_OP(OP_LE, <=); DEFINE_COMP_OP(OP_LE, <=);
CASE(OP_STOP) { CASE(OP_STOP) {
pic_value val;
val = POP();
#if VM_DEBUG #if VM_DEBUG
puts("**VM END STATE**"); puts("**VM END STATE**");
printf("stbase\t= %p\nsp\t= %p\n", (void *)stbase, (void *)pic->sp); printf("stbase\t= %p\nsp\t= %p\n", (void *)stbase, (void *)pic->sp);
printf("cibase\t= %p\nci\t= %p\n", (void *)cibase, (void *)pic->ci); printf("cibase\t= %p\nci\t= %p\n", (void *)cibase, (void *)pic->ci);
if (stbase < pic->sp) { if (stbase < pic->sp - 1) {
pic_value *sp; pic_value *sp;
printf("* stack trace:"); printf("* stack trace:");
for (sp = stbase; pic->sp != sp; ++sp) { for (sp = stbase; pic->sp != sp; ++sp) {
@ -930,14 +927,12 @@ pic_apply(pic_state *pic, struct pic_proc *proc, pic_value argv)
puts(""); puts("");
} }
} }
if (stbase > pic->sp) { if (stbase > pic->sp - 1) {
puts("*** stack underflow!"); puts("*** stack underflow!");
} }
#endif #endif
pic_gc_protect(pic, val); return pic_gc_protect(pic, POP());
return val;
} }
} VM_LOOP_END; } VM_LOOP_END;
} }