Fixed bug where vm_print_program listing for program was incorrect
Only happens when vm_print_program(STDERR), as STDERR occurs before STDOUT on Emacs. So while the lines would print, no instructions would follow. This fixes that by using fp.
This commit is contained in:
@@ -267,7 +267,7 @@ void vm_print_program(vm_t *vm, FILE *fp)
|
||||
for (size_t i = beg; i < end; ++i)
|
||||
{
|
||||
fprintf(fp, "\t%lu: ", i);
|
||||
inst_print(program.instructions[i], stdout);
|
||||
inst_print(program.instructions[i], fp);
|
||||
if (i == program.ptr)
|
||||
fprintf(fp, " <---");
|
||||
fprintf(fp, "\n");
|
||||
|
||||
Reference in New Issue
Block a user