aboutsummaryrefslogtreecommitdiff
path: root/binutils/bin2c.c
diff options
context:
space:
mode:
authorYao Qi <yao.qi@linaro.org>2017-11-15 09:36:51 +0000
committerYao Qi <yao.qi@linaro.org>2017-11-15 09:36:51 +0000
commita714b0d6928ba195623ec2825b00c446939f6e59 (patch)
tree1c90e74f5472279243ecaea308009920fafa0166 /binutils/bin2c.c
parent390a67891e4f1ed334e266cf084ba8948da5fcdf (diff)
downloadgdb-a714b0d6928ba195623ec2825b00c446939f6e59.zip
gdb-a714b0d6928ba195623ec2825b00c446939f6e59.tar.gz
gdb-a714b0d6928ba195623ec2825b00c446939f6e59.tar.bz2
Fix M68HC11_NUM_REGS
M68HC11_LAST_HARD_REG is 8, but m68hc11 register number is started from 0, so there are 9 raw registers, but M68HC11_NUM_REGS is 8 by mistake. My following unit test can find this issue (GDB is built with asan) ================================================================= ==15555==ERROR: AddressSanitizer: heap-buffer-overflow on address 0x602000113150 at pc 0x51393f bp 0x7fffcec36f60 sp 0x7fffcec36f58 WRITE of size 2 at 0x602000113150 thread T0 #0 0x51393e in m68hc11_pseudo_register_read gdb/m68hc11-tdep.c:320 #1 0xc4b620 in gdbarch_pseudo_register_read(gdbarch*, regcache*, int, unsigned char*) gdb/gdbarch.c:1974 #2 0xddad88 in regcache::cooked_read(int, unsigned char*) gdb/regcache.c:710 #3 0xddff2b in cooked_read_test gdb/regcache.c:1850 #4 0xdf8cfb in selftests::gdbarch_selftest::operator()() const gdb/selftest-arch.c:73 gdb: 2017-11-15 Yao Qi <yao.qi@linaro.org> * m68hc11-tdep.c (M68HC11_NUM_REGS): Change it to M68HC11_LAST_HARD_REG + 1.
Diffstat (limited to 'binutils/bin2c.c')
0 files changed, 0 insertions, 0 deletions