From 68edc24b667b287d6b4d73d119fc9676013b2ff6 Mon Sep 17 00:00:00 2001 From: Mark Pizzolato Date: Fri, 8 Sep 2017 05:47:36 -0700 Subject: [PATCH] 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. --- TX-0/tx0_cpu.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/TX-0/tx0_cpu.c b/TX-0/tx0_cpu.c index 28a61646..869b5b31 100644 --- a/TX-0/tx0_cpu.c +++ b/TX-0/tx0_cpu.c @@ -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; const char *cptr = (const char *) desc; t_stat r; -t_value sim_eval; InstHistory *h; 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 */ 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);