![]() | Fun 0.41.5 The programming language that makes You have fun |
Implements the OP_STORE_LOCAL opcode for storing local variables in the VM. More...

Go to the source code of this file.
Functions | |
| if (slot< 0||slot >=MAX_FRAME_LOCALS) | |
| free_value (f->locals[slot]) | |
Variables | |
| case | OP_STORE_LOCAL |
| Value | v = pop_value(vm) |
| f | locals [slot] = v |
| break | |
Implements the OP_STORE_LOCAL opcode for storing local variables in the VM.
This file handles the OP_STORE_LOCAL instruction, which stores a value into a local variable using its index.
Behavior:
Error Handling:
Example: // Bytecode: OP_STORE_LOCAL 0 // Stack before: [42] // Stack after: []
Definition in file store_local.c.
| free_value | ( | f-> | locals[slot] | ) |
| if | ( | slot< 0||slot > | = MAX_FRAME_LOCALS | ) |
Definition at line 32 of file store_local.c.
| break |
Definition at line 40 of file store_local.c.
Definition at line 39 of file store_local.c.
| case OP_STORE_LOCAL |
Definition at line 30 of file store_local.c.
| Value v = pop_value(vm) |
Definition at line 36 of file store_local.c.