summaryrefslogtreecommitdiff
path: root/kernel/exec.c
diff options
context:
space:
mode:
usertest for exec() out of memory recovery
and fix a few exec() bugs
Diffstat (limited to 'kernel/exec.c')
-rw-r--r--kernel/exec.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/kernel/exec.c b/kernel/exec.c
index 8a2d1dc..0e8762f 100644
--- a/kernel/exec.c
+++ b/kernel/exec.c
@@ -67,8 +67,10 @@ exec(char *path, char **argv)
// Allocate two pages at the next page boundary.
// Use the second as the user stack.
sz = PGROUNDUP(sz);
- if((sz = uvmalloc(pagetable, sz, sz + 2*PGSIZE)) == 0)
+ uint64 sz1;
+ if((sz1 = uvmalloc(pagetable, sz, sz + 2*PGSIZE)) == 0)
goto bad;
+ sz = sz1;
uvmclear(pagetable, sz-2*PGSIZE);
sp = sz;
stackbase = sp - PGSIZE;