aboutsummaryrefslogtreecommitdiff
path: root/exec.c
diff options
context:
space:
mode:
authorMax Filippov <jcmvbkbc@gmail.com>2014-09-17 22:03:36 -0700
committerPeter Maydell <peter.maydell@linaro.org>2014-09-19 17:42:16 +0100
commit07e2863d0271ac6c05206d8ce9e4f4c39b25d3ea (patch)
treef49dbd20beb412ebefe7c3294d0a34555281f976 /exec.c
parent4852ee95f3a7ed8a02672b0fd0377167da5ed686 (diff)
exec.c: fix setting 1-byte-long watchpoints
With commit 05068c0dfb5b 'exec.c: Relax restrictions on watchpoint length and alignment' it's no longer possible to set 1-byte-long watchpoint because of incorrect address range check. Fix that by changing condition that checks for address wraparound. Signed-off-by: Max Filippov <jcmvbkbc@gmail.com> Reviewed-by: Peter Maydell <peter.maydell@linaro.org> Message-id: 1411016616-29879-1-git-send-email-jcmvbkbc@gmail.com Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
Diffstat (limited to 'exec.c')
-rw-r--r--exec.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/exec.c b/exec.c
index 2b2465117e..759055d0e3 100644
--- a/exec.c
+++ b/exec.c
@@ -595,7 +595,7 @@ int cpu_watchpoint_insert(CPUState *cpu, vaddr addr, vaddr len,
CPUWatchpoint *wp;
/* forbid ranges which are empty or run off the end of the address space */
- if (len == 0 || (addr + len - 1) <= addr) {
+ if (len == 0 || (addr + len - 1) < addr) {
error_report("tried to set invalid watchpoint at %"
VADDR_PRIx ", len=%" VADDR_PRIu, addr, len);
return -EINVAL;