diff options
author | Andreas Hansson <andreas.hansson@arm.com> | 2014-11-24 09:03:38 -0500 |
---|---|---|
committer | Andreas Hansson <andreas.hansson@arm.com> | 2014-11-24 09:03:38 -0500 |
commit | d66b14ca61bec95a4049e5aae468904395055efd (patch) | |
tree | 6ddaf6bd4a792f0fe3125d57dae95fb9099dd7b7 /src/sim | |
parent | 1f539f13c32ad5a9187d56a098d4c857639b0e05 (diff) | |
download | gem5-d66b14ca61bec95a4049e5aae468904395055efd.tar.xz |
misc: Another round of static analysis fixups
Mostly addressing uninitialised members.
Diffstat (limited to 'src/sim')
-rw-r--r-- | src/sim/insttracer.hh | 9 | ||||
-rw-r--r-- | src/sim/process.cc | 2 | ||||
-rw-r--r-- | src/sim/syscall_emul.cc | 6 |
3 files changed, 8 insertions, 9 deletions
diff --git a/src/sim/insttracer.hh b/src/sim/insttracer.hh index 596712120..df1f12766 100644 --- a/src/sim/insttracer.hh +++ b/src/sim/insttracer.hh @@ -94,13 +94,10 @@ class InstRecord : when(_when), thread(_thread), staticInst(_staticInst), pc(_pc), macroStaticInst(_macroStaticInst), - misspeculating(spec), predicate(true) + misspeculating(spec), predicate(true), addr(0), addr_valid(false), + data_status(DataInvalid), + fetch_seq(0), fetch_seq_valid(false), cp_seq(0), cp_seq_valid(false) { - data_status = DataInvalid; - addr_valid = false; - - fetch_seq_valid = false; - cp_seq_valid = false; } virtual ~InstRecord() { } diff --git a/src/sim/process.cc b/src/sim/process.cc index 0412c27e0..2e5f64497 100644 --- a/src/sim/process.cc +++ b/src/sim/process.cc @@ -104,7 +104,9 @@ template struct AuxVector<uint64_t>; Process::Process(ProcessParams * params) : SimObject(params), system(params->system), + brk_point(0), stack_base(0), stack_size(0), stack_min(0), max_stack_size(params->max_stack_size), + next_thread_stack_base(0), M5_pid(system->allocatePID()), useArchPT(params->useArchPT), kvmInSE(params->kvmInSE), diff --git a/src/sim/syscall_emul.cc b/src/sim/syscall_emul.cc index cb592e338..37d0121c5 100644 --- a/src/sim/syscall_emul.cc +++ b/src/sim/syscall_emul.cc @@ -228,6 +228,7 @@ readFunc(SyscallDesc *desc, int num, LiveProcess *p, ThreadContext *tc) { int index = 0; int fd = p->sim_fd(p->getSyscallArg(tc, index)); + assert(fd >= 0); Addr bufPtr = p->getSyscallArg(tc, index); int nbytes = p->getSyscallArg(tc, index); BufferArg bufArg(bufPtr, nbytes); @@ -264,6 +265,7 @@ lseekFunc(SyscallDesc *desc, int num, LiveProcess *p, ThreadContext *tc) { int index = 0; int fd = p->sim_fd(p->getSyscallArg(tc, index)); + assert(fd >= 0); uint64_t offs = p->getSyscallArg(tc, index); int whence = p->getSyscallArg(tc, index); @@ -278,6 +280,7 @@ _llseekFunc(SyscallDesc *desc, int num, LiveProcess *p, ThreadContext *tc) { int index = 0; int fd = p->sim_fd(p->getSyscallArg(tc, index)); + assert(fd >= 0); uint64_t offset_high = p->getSyscallArg(tc, index); uint32_t offset_low = p->getSyscallArg(tc, index); Addr result_ptr = p->getSyscallArg(tc, index); @@ -301,9 +304,6 @@ _llseekFunc(SyscallDesc *desc, int num, LiveProcess *p, ThreadContext *tc) result_buf.copyOut(tc->getMemProxy()); return 0; } - - - return (result == (off_t)-1) ? -errno : result; } |