types fix, frame fix to work with runtime

This commit is contained in:
ProgramSnail 2024-11-01 20:54:48 +03:00
parent 26a42d4c81
commit 39715334c7
5 changed files with 92 additions and 176 deletions

View file

@ -111,19 +111,19 @@ void run(bytefile *bf) {
case 9: // DUP
{ // guess
if (s.vp == s.stack || (s.fp != NULL && s.vp == s.fp->end)) {
if (s.sp == s.stack || (s.fp != NULL && s.sp == s.fp->end)) {
failure("can't DUP: no value on stack");
}
*s.vp = *(s.vp - 1);
++s.vp;
*s.sp = *(s.sp - 1);
++s.sp;
break;
}
case 10: // SWAP
{ // guess
struct NilT* v = *s.vp;
*s.vp = *(s.vp - 1);
*(s.vp - 1) = v;
struct NilT* v = *s.sp;
*s.sp = *(s.sp - 1);
*(s.sp - 1) = v;
}
break;