diff options
-rw-r--r-- | Makefile | 2 | ||||
-rw-r--r-- | vm/runtime.c | 2 |
2 files changed, 2 insertions, 2 deletions
@@ -4,7 +4,7 @@ GENERAL-FLAGS=-Wall -Wextra -Werror -Wswitch-enum -std=c11 -I. DEBUG-FLAGS=-ggdb -fsanitize=address RELEASE-FLAGS=-O3 CFLAGS:=$(GENERAL-FLAGS) $(DEBUG-FLAGS) -D VERBOSE=$(VERBOSE) -LIBS= +LIBS=-lm DIST=build TERM_YELLOW:=$(shell echo -e "\e[0;33m") TERM_GREEN:=$(shell echo -e "\e[0;32m") diff --git a/vm/runtime.c b/vm/runtime.c index 421256a..1f5396a 100644 --- a/vm/runtime.c +++ b/vm/runtime.c @@ -371,7 +371,7 @@ void vm_print_registers(vm_t *vm, FILE *fp) vm->registers.available / HWORD_SIZE, vm->registers.available / WORD_SIZE); fprintf(fp, "Registers.reg = ["); - for (size_t i = 0; i < (reg.used / WORD_SIZE); ++i) + for (size_t i = 0; i < ceil((long double)reg.used / WORD_SIZE); ++i) { fprintf(fp, "{%lu:%lX}", i, VM_NTH_REGISTER(reg, i)); if (i != reg.used - 1) |