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...
[simgrid.git] / teshsuite / s4u / comm-fault-scenarios / comm-fault-scenarios.cpp
index 6f674fa..fb881c8 100644 (file)
@@ -1,4 +1,4 @@
-/* Copyright (c) 2010-2022. The SimGrid Team. All rights reserved.          */
+/* Copyright (c) 2010-2023. The SimGrid Team. All rights reserved.          */
 
 /* This program is free software; you can redistribute it and/or modify it
  * under the terms of the license (GNU LGPL) which comes with this package. */
@@ -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++;