umx

UMX VM implementation (ifcfc '06)
git clone git://bsandro.tech/umx
Log | Files | Refs

commit e40b7132628ca99d5a3ebe5d61ea46855c3dd010
parent 9c1d441ae0ba390b790332229e37df211ab5b20b
Author: bsandro <brian.drosan@gmail.com>
Date:   Tue, 11 Jan 2022 17:49:19 +0200

File load bugfix (\r -> \n)

Diffstat:
Mmain.c | 6++++--
Mumx | 0
2 files changed, 4 insertions(+), 2 deletions(-)

diff --git a/main.c b/main.c @@ -67,7 +67,7 @@ void array_dup(struct arena_t *arena, uint32_t index); int main(void) { - FILE *f = fopen(FILENAME, "r"); + FILE *f = fopen(FILENAME, "rb"); struct state_t *state = (struct state_t *)malloc(sizeof(struct state_t)); struct stat fileinfo; size_t read_platters = 0; @@ -187,7 +187,9 @@ uint32_t array_new(struct arena_t *arena, uint32_t size) { arena->arrays = (struct array_t *)realloc(arena->arrays, arena->size * sizeof(struct array_t)); arena->arrays[array_index].data = (uint32_t *)calloc(size, PLATTER_SIZE); arena->arrays[array_index].size = size; - assert(arena->arrays[array_index].data != NULL); + if (size > 0) { + assert(arena->arrays[array_index].data != NULL); + } return array_index; } diff --git a/umx b/umx Binary files differ.