1
0
mirror of https://github.com/pevans/erc-c.git synced 2024-08-21 00:29:00 +00:00

We should also NULL out segment memory.

Er... oops
This commit is contained in:
Peter Evans 2017-12-12 14:33:55 -06:00
parent 06705f21fc
commit 6f4627802f

View File

@ -38,6 +38,10 @@ vm_segment_create(size_t size)
return NULL;
}
// We should NULL out memory and make explicit that any new segment
// begins life in that state.
memset(segment->memory, (int)NULL, sizeof(vm_8bit));
segment->read_table = malloc(sizeof(vm_segment_read_fn) * size);
if (segment->read_table == NULL) {
log_critical("Couldn't allocate enough space for segment read_table");