1
0
mirror of https://github.com/open-simh/simh.git synced 2026-04-24 19:40:22 +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:52:00 -07:00
committed by Mark Pizzolato
parent f51b621f62
commit 3f8533d957
7 changed files with 33 additions and 26 deletions

View File

@@ -1,6 +1,6 @@
/* nova_cpu.c: NOVA CPU simulator
Copyright (c) 1993-2013, 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 Nova central processor
07-Sep-17 RMS Fixed sim_eval declaration in history routine (COVERITY)
17-Mar-13 RMS Added clarifying brances to IND_STEP macro (Dave Bryan)
04-Jul-07 BKR DEV_SET/CLR macros now used,
support for non-existant devices added
@@ -1372,7 +1373,7 @@ return ( SCPE_OK ) ;
int hist_fprintf( FILE * fp, int itemNum, Hist_entry * hptr )
{
t_value sim_eval ;
extern t_value *sim_eval ;
if ( hptr )
{
@@ -1394,8 +1395,8 @@ if ( hptr )
fprintf( fp, "%06o %06o ", SP, FP ) ;
}
sim_eval = (hptr->ir & 0xFFFF) ;
if ( (fprint_sym(fp, (hptr->pc & AMASK), &sim_eval, &cpu_unit, SWMASK ('M'))) > 0 )
sim_eval[0] = (hptr->ir & 0xFFFF) ;
if ( (fprint_sym(fp, (hptr->pc & AMASK), sim_eval, &cpu_unit, SWMASK ('M'))) > 0 )
{
fprintf( fp, "(undefined) %04o", (hptr->ir & 0xFFFF) ) ;
}