mirror of
https://github.com/pevans/erc-c.git
synced 2025-02-21 04:29:10 +00:00
We should also NULL out segment memory.
Er... oops
This commit is contained in:
parent
06705f21fc
commit
6f4627802f
@ -38,6 +38,10 @@ vm_segment_create(size_t size)
|
|||||||
return NULL;
|
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);
|
segment->read_table = malloc(sizeof(vm_segment_read_fn) * size);
|
||||||
if (segment->read_table == NULL) {
|
if (segment->read_table == NULL) {
|
||||||
log_critical("Couldn't allocate enough space for segment read_table");
|
log_critical("Couldn't allocate enough space for segment read_table");
|
||||||
|
Loading…
x
Reference in New Issue
Block a user