sim: h8300: move unused/buggy lregs array

This array isn't used anywhere, and the init phase actually corrupts
some memory because the array has 18 elements but tries to set the
19th (ZERO) position.
This commit is contained in:
Mike Frysinger 2015-12-30 01:49:53 -05:00
parent f2089a69c1
commit c78dff2291
2 changed files with 5 additions and 4 deletions

View File

@ -1,3 +1,8 @@
2015-12-30 Mike Frysinger <vapier@gentoo.org>
* compile.c (lreg): Delete.
(init_pointers): Delete lreg assignments.
2015-12-30 Mike Frysinger <vapier@gentoo.org>
* inst.h: Delete file.

View File

@ -1251,7 +1251,6 @@ compile (SIM_DESC sd, int pc)
static unsigned char *breg[32];
static unsigned short *wreg[16];
static unsigned int *lreg[18];
#define GET_B_REG(X) *(breg[X])
#define SET_B_REG(X, Y) (*(breg[X])) = (Y)
@ -1828,11 +1827,8 @@ init_pointers (SIM_DESC sd)
sim_io_printf (sd, "init_pointers: internal error.\n");
h8_set_reg (sd, i, 0);
lreg[i] = h8_get_reg_buf (sd) + i;
}
/* Note: sim uses pseudo-register ZERO as a zero register. */
lreg[ZERO_REGNUM] = h8_get_reg_buf (sd) + ZERO_REGNUM;
init_pointers_needed = 0;
/* Initialize the seg registers. */