ufff
This commit is contained in:
parent
c8b8dd820e
commit
0e7fffcfe0
67 changed files with 154 additions and 65 deletions
14
src/vm_case_print.c
Normal file
14
src/vm_case_print.c
Normal file
|
|
@ -0,0 +1,14 @@
|
|||
case OP_PRINT: {
|
||||
Value v = pop_value(vm);
|
||||
/* snapshot value at print time (deep copy arrays) */
|
||||
Value snap = deep_copy_value(&v);
|
||||
free_value(v);
|
||||
if (vm->output_count < VM_OUTPUT_SIZE) {
|
||||
vm->output[vm->output_count++] = snap; // store snapshot
|
||||
} else {
|
||||
free_value(snap); // prevent leak
|
||||
fprintf(stderr, "Runtime error: output buffer overflow\n");
|
||||
exit(1);
|
||||
}
|
||||
break;
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue