BESM6: Fixed memory access issues (COVERITY).
This commit is contained in:
parent
828fe4c901
commit
9e318d16a2
3 changed files with 10 additions and 8 deletions
|
@ -2,7 +2,7 @@
|
|||
* besm6_mmu.c: BESM-6 fast write cache and TLB registers
|
||||
*(стойка БРУС)
|
||||
*
|
||||
* Copyright (c) 2009, Leonid Broukhis
|
||||
* Copyright (c) 2009-2017, Leonid Broukhis
|
||||
*
|
||||
* Permission is hereby granted, free of charge, to any person obtaining a
|
||||
* copy of this software and associated documentation files (the "Software"),
|
||||
|
@ -623,7 +623,7 @@ t_value mmu_prefetch (int addr, int actual)
|
|||
return 0;
|
||||
} else {
|
||||
/* Чтобы лампочки мигали */
|
||||
i = addr & 3;
|
||||
i = addr;
|
||||
}
|
||||
|
||||
if (addr < 0100000) {
|
||||
|
@ -645,7 +645,7 @@ t_value mmu_prefetch (int addr, int actual)
|
|||
}
|
||||
} else
|
||||
val = memory[addr];
|
||||
BRS[i] = val;
|
||||
BRS[i & 3] = val;
|
||||
return val;
|
||||
}
|
||||
|
||||
|
|
|
@ -173,7 +173,7 @@ static void pi_to_bytes(int unit, int card, unsigned char buf[120]) {
|
|||
static void pi_punch_binary(int unit, int card) {
|
||||
UNIT *u = &pi_unit[unit];
|
||||
FILE * f = u->fileref;
|
||||
unsigned char buf[120];
|
||||
static unsigned char buf[120];
|
||||
pi_to_bytes(unit, card, buf);
|
||||
fwrite(buf, 120, 1, f);
|
||||
}
|
||||
|
@ -226,7 +226,7 @@ static void pi_punch_visual(int unit, int card) {
|
|||
static void pi_punch_gost(int unit, int card) {
|
||||
UNIT *u = &pi_unit[unit];
|
||||
FILE * f = u->fileref;
|
||||
unsigned char buf[120];
|
||||
static unsigned char buf[120];
|
||||
int len;
|
||||
int cur;
|
||||
int zero_expected = 0;
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
/*
|
||||
* besm6_tty.c: BESM-6 teletype device
|
||||
*
|
||||
* Copyright (c) 2009, Leo Broukhis
|
||||
* Copyright (c) 2009-2017, Leo Broukhis
|
||||
* Copyright (c) 2009, Serge Vakulenko
|
||||
* Permission is hereby granted, free of charge, to any person obtaining a
|
||||
* copy of this software and associated documentation files (the "Software"),
|
||||
|
@ -72,8 +72,10 @@ char * process (int sym)
|
|||
/* For serial lines */
|
||||
int tty_active [TTY_MAX+1], tty_sym [TTY_MAX+1];
|
||||
int tty_typed [TTY_MAX+1], tty_instate [TTY_MAX+1];
|
||||
time_t tty_last_time [TTY_MAX+1];
|
||||
int tty_idle_count [TTY_MAX+1];
|
||||
|
||||
/* For all lines */
|
||||
time_t tty_last_time [LINES_MAX+1];
|
||||
int tty_idle_count [LINES_MAX+1];
|
||||
|
||||
/* The serial interrupt generator frequency, common for all VT lines */
|
||||
int tty_rate = 300;
|
||||
|
|
Loading…
Add table
Reference in a new issue