syscall: missing initializer in getcwd call
authorVince Weaver <vince@csl.cornell.edu>
Mon, 9 Nov 2009 15:02:55 +0000 (10:02 -0500)
committerVince Weaver <vince@csl.cornell.edu>
Mon, 9 Nov 2009 15:02:55 +0000 (10:02 -0500)
This one case was missed during the update to stack-based arguments.
Without this fix, m5 will crash during a gwtcwd call, at least
with X86.

src/sim/syscall_emul.cc

index 7cffffcf1c3b6fcf7649036d5276d15ed6dcae8a..4461e8b528c8510f5d3e4a3a1023cb974c0351b5 100644 (file)
@@ -306,7 +306,7 @@ SyscallReturn
 getcwdFunc(SyscallDesc *desc, int num, LiveProcess *p, ThreadContext *tc)
 {
     int result = 0;
-    int index;
+    int index = 0;
     Addr bufPtr = p->getSyscallArg(tc, index);
     unsigned long size = p->getSyscallArg(tc, index);
     BufferArg buf(bufPtr, size);