Some more internal optimizations. (0.41.15)
This commit is contained in:
parent
0d6685abcd
commit
a5de8b167a
13 changed files with 194 additions and 25 deletions
|
|
@ -23,10 +23,7 @@
|
|||
*/
|
||||
|
||||
case OP_SWAP: {
|
||||
if (vm->sp < 1) {
|
||||
fprintf(stderr, "Runtime error: stack underflow for SWAP\n");
|
||||
exit(1);
|
||||
}
|
||||
vm_require_stack(vm, 2);
|
||||
Value a = vm->stack[vm->sp];
|
||||
Value b = vm->stack[vm->sp - 1];
|
||||
vm->stack[vm->sp] = b;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue