From 9e09cc64cbe18e1cbb03b9fa6a2e4cbca10c01db Mon Sep 17 00:00:00 2001 From: Moon Flower Date: Wed, 27 Aug 2025 19:16:34 +0330 Subject: pu3 poc3 --- pu3/pu3.cpu.c | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'pu3/pu3.cpu.c') 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, -- cgit v1.2.3