VAX750: Avoid unit array overrun during TU58 init when only 1 unit exists.
As discussed in #546
This commit is contained in:
parent
a92dc610a4
commit
e7e1a9cc2c
1 changed files with 3 additions and 1 deletions
|
@ -456,6 +456,8 @@ OP CODE 11 (Resened)
|
|||
|
||||
#include "pdp11_td.h"
|
||||
|
||||
#define MIN(a,b) (((a) < (b)) ? (a) : (b))
|
||||
|
||||
/* DL Definitions */
|
||||
|
||||
/* registers */
|
||||
|
@ -994,7 +996,7 @@ switch (opcode) {
|
|||
break;
|
||||
|
||||
case TD_OPINI:
|
||||
for (unit=0; unit < 2; unit++)
|
||||
for (unit=0; unit < MIN(ctlr->dptr->numunits, 2); unit++)
|
||||
sim_cancel (ctlr->uptr+unit);
|
||||
ctlr->ibptr = 0;
|
||||
ctlr->obptr = 0;
|
||||
|
|
Loading…
Add table
Reference in a new issue