TX-0: 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:
Mark Pizzolato 2017-09-08 05:47:36 -07:00
parent 5b5e0f9c35
commit 68edc24b66

View file

@ -1160,7 +1160,6 @@ t_stat cpu_show_hist (FILE *st, UNIT *uptr, int32 val, CONST void *desc)
int32 ov, pf, op, k, di, lnt; int32 ov, pf, op, k, di, lnt;
const char *cptr = (const char *) desc; const char *cptr = (const char *) desc;
t_stat r; t_stat r;
t_value sim_eval;
InstHistory *h; InstHistory *h;
if (hst_lnt == 0) return SCPE_NOFNC; /* enabled? */ if (hst_lnt == 0) return SCPE_NOFNC; /* enabled? */
@ -1183,8 +1182,8 @@ for (k = 0; k < lnt; k++) { /* print specified */
if ((op < 032) && (op != 007)) /* mem ref instr */ if ((op < 032) && (op != 007)) /* mem ref instr */
fprintf (st, "%06o ", h->ea); fprintf (st, "%06o ", h->ea);
else fprintf (st, " "); else fprintf (st, " ");
sim_eval = h->ir; sim_eval[0] = h->ir;
if ((fprint_sym (st, h->pc & AMASK, &sim_eval, &cpu_unit, SWMASK ('M'))) > 0) if ((fprint_sym (st, h->pc & AMASK, sim_eval, &cpu_unit, SWMASK ('M'))) > 0)
fprintf (st, "(undefined) %06o", h->ir); fprintf (st, "(undefined) %06o", h->ir);
else if (op < 030) /* mem ref instr */ else if (op < 030) /* mem ref instr */
fprintf (st, " [%06o]", h->opnd); fprintf (st, " [%06o]", h->opnd);