riscv-013: Correct sign extension of address on read_memory for lower bits as well

This commit is contained in:
Megan Wachs 2017-05-01 09:39:59 -07:00
parent 8462750357
commit 458bb20699
1 changed files with 1 additions and 1 deletions

View File

@ -1267,7 +1267,7 @@ static int read_memory(struct target *target, uint32_t address,
case 64:
riscv_program_write_ram(&program, r_addr + 4, (((riscv_addr_t)(address)) - size) >> 32);
case 32:
riscv_program_write_ram(&program, r_addr, (riscv_addr_t)(address - size));
riscv_program_write_ram(&program, r_addr, (riscv_addr_t)(address) - size);
break;
default:
LOG_ERROR("unknown XLEN %d", riscv_xlen(target));