1
0
mirror of https://github.com/open-simh/simh.git synced 2026-01-13 15:27:46 +00:00

SDS: trap_P not set if mem mgt trap during fetch (COVERITY)

This commit is contained in:
Bob Supnik 2017-03-09 19:28:19 -08:00 committed by Mark Pizzolato
parent 6cd53d9d86
commit 888b84af54

View File

@ -1,6 +1,6 @@
/* sds_cpu.c: SDS 940 CPU simulator
Copyright (c) 2001-2008, Robert M. Supnik
Copyright (c) 2001-2017, Robert M. Supnik
Permission is hereby granted, free of charge, to any person obtaining a
copy of this software and associated documentation files (the "Software"),
@ -26,6 +26,7 @@
cpu central processor
rtc real time clock
09-Mar-17 RMS trap_P not set if mem mgt trap during fetch (COVERITY)
28-Apr-07 RMS Removed clock initialization
29-Dec-06 RMS Fixed breakpoint variable declarations
16-Aug-05 RMS Fixed C++ declaration and cast problems
@ -454,7 +455,8 @@ while (reason == 0) { /* loop until halted */
break;
}
}
reason = Read (save_P = P, &inst); /* get instr */
trap_P = save_P = P; /* set backups for fetch */
reason = Read (P, &inst); /* get instr */
P = (P + 1) & VA_MASK; /* incr PC */
if (reason == SCPE_OK) { /* fetch ok? */
ion_defer = 0; /* clear ion */