![]() | Fun 0.41.5 The programming language that makes You have fun |
Execute a bytecode program starting from the given entry point. More...

Go to the source code of this file.
Functions | |
| if ((a.type==VAL_INT||a.type==VAL_FLOAT) &&(b.type==VAL_INT||b.type==VAL_FLOAT)) | |
| else | if (a.type==VAL_STRING &&b.type==VAL_STRING) |
| exit (1) | |
Variables | |
| case | OP_ADD |
| Value | a = pop_value(vm) |
| else | |
| break | |
Execute a bytecode program starting from the given entry point.
Implements the OP_ADD opcode for arithmetic and string concatenation in the VM.
Sets up the initial frame and runs the main interpreter loop until there are no more frames. Honors debugger stepping/finish/continue requests and, when enabled, traps exit paths to enter a REPL via on_error_repl.
| vm | VM instance to run. |
| entry | Entry function bytecode (must not be NULL). |
This file handles the OP_ADD instruction, which performs addition or concatenation depending on the types of the operands:
Behavior:
Error Handling:
Example: // Bytecode: OP_ADD // Stack before: [2, 3] // Stack after: [5]
Definition in file add.c.
| exit | ( | 1 | ) |
| else if | ( | a. | type = = VAL_STRING && b.type == VAL_STRING | ) |
| else |