From 45ad8f7296722cc3cec0a6974f9d2519c9f36d4b Mon Sep 17 00:00:00 2001 From: Aryadev Chavali Date: Mon, 23 Oct 2023 00:08:53 +0100 Subject: 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. --- src/runtime.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/runtime.c b/src/runtime.c index df2a460..ac1cf58 100644 --- a/src/runtime.c +++ b/src/runtime.c @@ -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"); -- cgit v1.2.3-13-gbd6f