1
0
mirror of https://github.com/simh/simh.git synced 2026-04-27 20:38:04 +00:00

TAPE: Fix potential crash in library unit tests

Improper declaration of state variables referenced in setjmp/longjmp.
This commit is contained in:
Larry Baker
2020-08-15 16:21:02 -07:00
committed by Mark Pizzolato
parent 272bbd4551
commit 4041894b67
3 changed files with 16 additions and 7 deletions

8
scp.h
View File

@@ -456,13 +456,13 @@ extern const char *sim_vm_step_unit; /* Simulator can change
These defines help implement consistent unit test functionality */
#define SIM_TEST_INIT \
int test_stat; \
const char *sim_test; \
volatile int test_stat; \
const char *volatile sim_test; \
jmp_buf sim_test_env; \
if ((test_stat = setjmp (sim_test_env))) { \
sim_printf ("Error: %d - '%s' processing: %s\n", \
test_stat, sim_error_text(test_stat), \
sim_test); \
SCPE_BARE_STATUS(test_stat), \
sim_error_text(test_stat), sim_test); \
return test_stat; \
}
#define SIM_TEST(_stat) \