Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
Fix unitialized value spotted by scan-build.
authorArnaud Giersch <arnaud.giersch@univ-fcomte.fr>
Sat, 9 Sep 2017 14:05:08 +0000 (16:05 +0200)
committerArnaud Giersch <arnaud.giersch@univ-fcomte.fr>
Sat, 9 Sep 2017 19:55:25 +0000 (21:55 +0200)
commit93a6d5f863fff05c78c6380f3cceaaa82fbca5f4
tree7d8a498b820d88d69b883ee01a0f69fa02279177
parenteb079ab441cd4822b1fe30ed95aacb2f787d4bcf
Fix unitialized value spotted by scan-build.

34  while (simgrid::s4u::Engine::getClock() < deadline) {
        # (1) Loop condition is true.  Entering loop body
35    void* received;
        # (2) 'received' declared without an initial value
36    if (comm == nullptr)
        # (3) Taking false branch
37      comm = mailbox->get_async(&received);
38    if (comm->test()) {
        # (4) Assuming the condition is true
        # (5) Taking true branch
39      // Retrieve the data sent by the peer.
40      TrackerQuery* tq = static_cast<TrackerQuery*>(received);
        # (6) Assigned value is garbage or undefined
examples/s4u/app-bittorrent/s4u_tracker.cpp