mirror of
https://github.com/ProgramSnail/Lama.git
synced 2025-12-06 06:48:48 +00:00
types fix, frame fix to work with runtime
This commit is contained in:
parent
26a42d4c81
commit
39715334c7
5 changed files with 92 additions and 176 deletions
|
|
@ -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;
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue