1
0
mirror of https://github.com/simh/simh.git synced 2026-04-15 16:11:13 +00:00

H316, I7094, NOVA, PDP1, PDP10, PDP8, SDS: Coverity singleton errors

Most history routines defined a local sim_eval of the proper length, but the
erroneous ones were fixed length machines that defined an integer variable
instead of an integer array of length 1. The VAX used the global sim_eval.
The changes follow the VAX practice.
This commit is contained in:
Bob Supnik
2017-09-07 09:59:04 -07:00
committed by Mark Pizzolato
parent e9d5e2e3c9
commit 5b5e0f9c35
7 changed files with 26 additions and 27 deletions

View File

@@ -1,6 +1,6 @@
/* pdp1_cpu.c: PDP-1 CPU simulator
Copyright (c) 1993-2015, Robert M. Supnik
Copyright (c) 1993-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"),
@@ -25,6 +25,7 @@
cpu PDP-1 central processor
07-Sep-17 RMS Fixed sim_eval declaration in history routine (COVERITY)
27-Mar-15 RMS Backported changes from GitHub master
21-Mar-12 RMS Fixed & vs && in Ea_ch (Michael Bloom)
30-May-07 RMS Fixed typo in SBS clear (Norm Lastovica)
@@ -1665,7 +1666,6 @@ t_stat cpu_show_hist (FILE *st, UNIT *uptr, int32 val, CONST void *desc)
int32 ov, pf, op, k, di, lnt;
const char *cptr = (const char *) desc;
t_stat r;
t_value sim_eval;
InstHistory *h;
if (hst_lnt == 0) /* enabled? */
@@ -1691,8 +1691,8 @@ for (k = 0; k < lnt; k++) { /* print specified */
if ((op < 032) && (op != 007)) /* mem ref instr */
fprintf (st, "%06o ", h->ea);
else fprintf (st, " ");
sim_eval = h->ir;
if ((fprint_sym (st, h->pc & AMASK, &sim_eval, &cpu_unit, SWMASK ('M'))) > 0)
sim_eval[0] = h->ir;
if ((fprint_sym (st, h->pc & AMASK, sim_eval, &cpu_unit, SWMASK ('M'))) > 0)
fprintf (st, "(undefined) %06o", h->ir);
else if (op < 030) /* mem ref instr */
fprintf (st, " [%06o]", h->opnd);