Fix clobbering s2 in read_memory_progbuf(increment=0)

Fixes #632.

Change-Id: Ic884823faf67749f1ac8fbd91fe67ff9ebdd8fd0
Signed-off-by: Tim Newsome <tim@sifive.com>
This commit is contained in:
Tim Newsome 2021-07-22 11:43:51 -07:00
parent f30837f04c
commit 83a87b2ccc
1 changed files with 1 additions and 1 deletions

View File

@ -3457,7 +3457,7 @@ static int read_memory_progbuf(struct target *target, target_addr_t address,
return ERROR_FAIL;
if (register_read(target, &s1, GDB_REGNO_S1) != ERROR_OK)
return ERROR_FAIL;
if (increment == 0 && register_read(target, &s2, GDB_REGNO_S1) != ERROR_OK)
if (increment == 0 && register_read(target, &s2, GDB_REGNO_S2) != ERROR_OK)
return ERROR_FAIL;
/* Write the program (load, increment) */