Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
don't create temporary struct at time of push_back as it may be deleted prematurely...
authorAugustin Degomme <adegomme@users.noreply.github.com>
Mon, 23 Jan 2023 11:23:27 +0000 (12:23 +0100)
committerAugustin Degomme <adegomme@users.noreply.github.com>
Mon, 23 Jan 2023 11:23:27 +0000 (12:23 +0100)
teshsuite/s4u/comm-fault-scenarios/comm-fault-scenarios.cpp

index 4066f4a..fb881c8 100644 (file)
@@ -457,7 +457,8 @@ static void prepareScenario(ScenarioContext& ctx, CommType type, double duration
           DIE_IMPOSSIBLE;
       }
     }
-    ctx.scenarios.push_back({type, ctx.start_time, duration, sender_expected, receiver_expected, steps, ctx.index});
+    Scenario scen{type, ctx.start_time, duration, sender_expected, receiver_expected, steps, ctx.index};
+    ctx.scenarios.push_back(scen);
     ctx.active++;
   }
   ctx.index++;