sim: Fix -Werror=maybe-uninitialized in system.cc
authorGiacomo Travaglini <giacomo.travaglini@arm.com>
Thu, 25 Jun 2020 08:27:58 +0000 (09:27 +0100)
committerGiacomo Travaglini <giacomo.travaglini@arm.com>
Thu, 25 Jun 2020 22:40:56 +0000 (22:40 +0000)
The patch is simply initializing when to 0 before unserializing
the real value

Change-Id: I4e19eeafa9334116b440948af1943f3835803671
Signed-off-by: Giacomo Travaglini <giacomo.travaglini@arm.com>
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/30594
Tested-by: kokoro <noreply+kokoro@google.com>
Reviewed-by: Daniel Carvalho <odanrc@yahoo.com.br>
Reviewed-by: Jason Lowe-Power <power.jg@gmail.com>
Maintainer: Jason Lowe-Power <power.jg@gmail.com>

src/sim/system.cc

index 413341274551ba53f3716d6e511db327c441f440..6e5975e9d6c3df166d5af83175b1fe6cbb546b41 100644 (file)
@@ -447,7 +447,7 @@ System::unserialize(CheckpointIn &cp)
     UNSERIALIZE_SCALAR(pagePtr);
 
     for (auto &t: threads.threads) {
-        Tick when;
+        Tick when = 0;
         ContextID id = t.context->contextId();
         if (!optParamIn(cp, csprintf("quiesceEndTick_%d", id), when) ||
                 !when || !t.resumeEvent) {