From: Timo Korvola Date: Sun, 21 Jan 2018 18:53:26 +0000 (+0200) Subject: Fix SEGV on undo past beginning of game. X-Git-Url: https://scope-eye.net/git/?a=commitdiff_plain;h=bb2819afa740842801eb3bbfa27aa423e6487322;p=liskon_frotz.git Fix SEGV on undo past beginning of game. --- diff --git a/src/common/fastmem.c b/src/common/fastmem.c index 113370e..8ad1ee8 100644 --- a/src/common/fastmem.c +++ b/src/common/fastmem.c @@ -867,8 +867,6 @@ static void mem_undiff (zbyte *diff, long diff_length, zbyte *dest) */ int restore_undo (void) { - long pc = curr_undo->pc; - if (f_setup.undo_slots == 0) /* undo feature unavailable */ return -1; @@ -880,7 +878,7 @@ int restore_undo (void) /* undo possible */ memcpy (zmp, prev_zmp, h_dynamic_size); - SET_PC (pc); + SET_PC (curr_undo->pc); sp = stack + STACK_SIZE - curr_undo->stack_size; fp = stack + curr_undo->frame_offset; frame_count = curr_undo->frame_count;