summaryrefslogtreecommitdiff
path: root/sim/syscall_emul.cc
diff options
context:
space:
mode:
Diffstat (limited to 'sim/syscall_emul.cc')
-rw-r--r--sim/syscall_emul.cc4
1 files changed, 3 insertions, 1 deletions
diff --git a/sim/syscall_emul.cc b/sim/syscall_emul.cc
index e953a7308..57ae39cf8 100644
--- a/sim/syscall_emul.cc
+++ b/sim/syscall_emul.cc
@@ -104,7 +104,9 @@ int
obreakFunc(SyscallDesc *desc, int num, Process *p, ExecContext *xc)
{
// change brk addr to first arg
- p->brk_point = xc->getSyscallArg(0);
+ Addr new_brk = xc->getSyscallArg(0);
+ if (new_brk != 0)
+ p->brk_point = xc->getSyscallArg(0);
return p->brk_point;
}