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

PDQ-3, SAGE: Coverity Fixes

CID       Action
   1416081   changed variable answer to int
   1416082   checked returned values with ASSURE - read error means corrupted target code.
   1416088   added return
   1416109   This fallthru was intentional - duplicated code to make coverity happy
   1416111   This fallthru was intentional - duplicated code to make coverity happy
   1416116   This fallthru was intentional - duplicated code to make coverity happy
   1416117   This fallthru was intentional - duplicated code to make coverity happy
   1416124   protected against negative return
   1416142   added ASSURE, however this case won't happen since reg_intpending==true implies positive int level
   1416145   checked non-NULL, return SCPE_ARG if NULL
   1416150   since only 2 drives are supported, fdc_selected is decoded to 0 and 1 only (allowed 2 and 3 before)
   1416152   restrict to 2 drives only
   1416166   checked value with ASSURE

   1416101   typo: should have been resx
   1416106   unnecessary code removed
   1416110   this fallthru was intentional - duplicated code to make coverity happy
   1416112   this fallthru was intentional - duplicated code to make coverity happy
   1416148   change condition to check for negative value
   1416179   break was remainder from former logic - removed
   1415866   code was remainder from former unimplemented instruction trap - removed
This commit is contained in:
Holger Veit
2017-03-27 06:57:43 -07:00
committed by Mark Pizzolato
parent 489752596b
commit 9a9b5deb9c
8 changed files with 31 additions and 18 deletions

View File

@@ -134,7 +134,7 @@ t_stat i8259_write(I8259* chip,int addr,uint32 value)
if (chip->isr & bit) break;
bit = bit << 1; if (bit==0x100) bit = 1;
}
chip->isr &= ~bit; break;
chip->isr &= ~bit;
if ((value & I8259_OCW2_MODE) == 0xa0) {
chip->prio = 7 - i + chip->prio; if (chip->prio>7) chip->prio -= 8;
}

View File

@@ -245,7 +245,6 @@ t_stat m68kcpu_peripheral_reset()
t_stat rc;
DEVICE** devs = sim_devices;
DEVICE* dptr;
if (!devs) return SCPE_IERR;
while ((dptr = *devs) != NULL) {
if (dptr != cpudev_self) {
@@ -1804,7 +1803,7 @@ do_bclr8: SETZ8(res & src1);
case 000600: case 001600: case 002600: case 003600:
case 004600: case 005600: case 006600: case 007600: /*chk*/
src1 = DRX;
SETF(src1 < 0,FLAG_N);
SETF((src1 & BIT31) != 0,FLAG_N);
ASSERT_OK(ea_src_w(IR_EAMOD,IR_EAREG,&res,&PC));
rc = CCR_N || src1 > res ? m68k_gen_exception(6,&PC) : SCPE_OK;
break;
@@ -2534,7 +2533,6 @@ do_neg32: res = m68k_sub32(0,srcx1,0,TRUE);
CLRF(FLAG_C|FLAG_V);
rc = ea_dst_w(EA_DDIR,IR_REGX,res,&PC);
break;
rc = STOP_IMPL; break;
case 0000200: case 00000220: case 0000230: case 0000240:
case 0000250: case 00000260: case 0000270: /* and.l -> d*/
ASSERT_OK(ea_src_l(IR_EAMOD,IR_EAREG,&src1,&PC));
@@ -3186,7 +3184,7 @@ do_ror32: reg = DR+IR_REGY;
if (cnt) {
cnt &= 31;
resx = (resx>>cnt) | (resx<<(32-cnt));
SETF(MASK_33(res),FLAG_C);
SETF(MASK_33(resx),FLAG_C);
*reg = (int32)resx;
} else {
CLRF(FLAG_C);

View File

@@ -115,6 +115,7 @@ static t_stat sioterm_svc(UNIT* uptr)
chip->crlf = chip->crlf==1 ? 2 : 0; break;
case 0:
if (chip->crlf==2) goto set_stat;
chip->crlf = 0; break;
default:
chip->crlf = 0;
}
@@ -390,6 +391,7 @@ static t_stat consterm_svc(UNIT* uptr)
chip->crlf = (chip->crlf==1) ? 2 : 0; break;
case 0:
if (chip->crlf==2) goto set_stat;
chip->crlf = 0; break;
default:
chip->crlf = 0;
}