diff options
Diffstat (limited to 'm68k_core.c')
-rw-r--r-- | m68k_core.c | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/m68k_core.c b/m68k_core.c index 438a1eb..e087f2f 100644 --- a/m68k_core.c +++ b/m68k_core.c @@ -1000,8 +1000,9 @@ void m68k_reset(m68k_context * context) m68k_context * init_68k_context(m68k_options * opts) { - m68k_context * context = malloc(sizeof(m68k_context) + ram_size(&opts->gen) / (1 << opts->gen.ram_flags_shift) / 8); - memset(context, 0, sizeof(m68k_context)); + size_t ctx_size = sizeof(m68k_context) + ram_size(&opts->gen) / (1 << opts->gen.ram_flags_shift) / 8; + m68k_context * context = malloc(ctx_size); + memset(context, 0, ctx_size); context->native_code_map = opts->gen.native_code_map; context->options = opts; context->int_cycle = CYCLE_NEVER; |