Refactored all OP_ functions to vm/CATEGORY/ and renamed the files.
This commit is contained in:
parent
108be8c41e
commit
50a91d0b6f
67 changed files with 91 additions and 92 deletions
10
src/vm/core/load_local.c
Normal file
10
src/vm/core/load_local.c
Normal file
|
|
@ -0,0 +1,10 @@
|
|||
case OP_LOAD_LOCAL: {
|
||||
int slot = inst.operand;
|
||||
if (slot < 0 || slot >= FRAME_MAX_LOCALS) {
|
||||
fprintf(stderr, "Runtime error: local slot out of range\n");
|
||||
exit(1);
|
||||
}
|
||||
Value val = copy_value(&f->locals[slot]);
|
||||
push_value(vm, val);
|
||||
break;
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue