cpu: Fix TraceGen flag initalisation
authorAndreas Hansson <andreas.hansson@arm.com>
Tue, 23 Apr 2013 09:07:10 +0000 (05:07 -0400)
committerAndreas Hansson <andreas.hansson@arm.com>
Tue, 23 Apr 2013 09:07:10 +0000 (05:07 -0400)
This patch ensures the flags are always initialised.

src/cpu/testers/traffic_gen/generators.cc

index 7fec2a34a425d77bf09a39a17757dde7974dd62f..22fffc9c3698f63bcb9f3477c5024892bbfb5597 100644 (file)
@@ -215,8 +215,7 @@ TraceGen::InputStream::read(TraceElement& element)
         element.addr = pkt_msg.addr();
         element.blocksize = pkt_msg.size();
         element.tick = pkt_msg.tick();
-        if (pkt_msg.has_flags())
-            element.flags = pkt_msg.flags();
+        element.flags = pkt_msg.has_flags() ? pkt_msg.flags() : 0;
         return true;
     }