sim: fix build breakage in process.cc after brandon@11801
authorBjoern A. Zeeb <baz21@cam.ac.uk>
Fri, 10 Feb 2017 00:03:58 +0000 (19:03 -0500)
committerBjoern A. Zeeb <baz21@cam.ac.uk>
Fri, 10 Feb 2017 00:03:58 +0000 (19:03 -0500)
Seeing build breakage after brandon@11801:

 [     CXX] X86/sim/process.cc -> .o build/X86/sim/process.cc:137:64:
error: field '_pid' is uninitialized when used here
[-Werror,-Wuninitialized] static_cast<PageTableBase *>(new
ArchPageTable(name(), _pid, system)) : ^ build/X86/sim/process.cc:138:64:
error: field '_pid' is uninitialized when used here
[-Werror,-Wuninitialized] static_cast<PageTableBase *>(new
FuncPageTable(name(), _pid))), ^ 2 errors generated.

Testing Done: Compiles now on FreeBSD 10 with clang.

Reviewed at http://reviews.gem5.org/r/3804/

Signed-off-by: Jason Lowe-Power <jason@lowepower.com>
src/sim/process.cc

index ff6297bbb1efa06f137e70c50573814276dc817d..961da1ecd0f0444e6f0da44b92d864b399035b95 100644 (file)
@@ -134,8 +134,9 @@ Process::Process(ProcessParams * params)
       useArchPT(params->useArchPT),
       kvmInSE(params->kvmInSE),
       pTable(useArchPT ?
-        static_cast<PageTableBase *>(new ArchPageTable(name(), _pid, system)) :
-        static_cast<PageTableBase *>(new FuncPageTable(name(), _pid))),
+        static_cast<PageTableBase *>(new ArchPageTable(name(), params->pid,
+            system)) :
+        static_cast<PageTableBase *>(new FuncPageTable(name(), params->pid))),
       initVirtMem(system->getSystemPort(), this,
                   SETranslatingPortProxy::Always),
       fd_array(make_shared<array<FDEntry, NUM_FDS>>()),