aboutsummaryrefslogtreecommitdiff
path: root/pu3/pu3.cpu.c
diff options
context:
space:
mode:
Diffstat (limited to 'pu3/pu3.cpu.c')
-rw-r--r--pu3/pu3.cpu.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/pu3/pu3.cpu.c b/pu3/pu3.cpu.c
index fe9838d..0597027 100644
--- a/pu3/pu3.cpu.c
+++ b/pu3/pu3.cpu.c
@@ -268,6 +268,10 @@ int main() {
const uint32_t SIZE = 1 << 24;
let mem_arr = calloc(SIZE, sizeof(pu3_inst_t));
+ if (!mem_arr) {
+ perror("memory allocation failed");
+ return 1;
+ }
pu3_ctx ctx = { .memory = { .memory_u64 = mem_arr, .memory_u32 = mem_arr },
.mem_size = SIZE,