From e5659516ff0df4462d1e07308152cd1ebbedf182 Mon Sep 17 00:00:00 2001 From: Stanislaw Halik Date: Sun, 4 Feb 2024 13:57:35 +0100 Subject: bench/dijkstra: fix use after free --- bench/dijkstra.cpp | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/bench/dijkstra.cpp b/bench/dijkstra.cpp index a50548d0..b0f1936d 100644 --- a/bench/dijkstra.cpp +++ b/bench/dijkstra.cpp @@ -9,13 +9,12 @@ namespace floormat { namespace { -auto A = astar(); -bool first_run = false; - void Dijkstra(benchmark::State& state) { (void)loader.wall_atlas_list(); auto w = world(); + auto A = astar(); + bool first_run = false; constexpr auto wcx = 1, wcy = 1, wtx = 8, wty = 8, wox = 0, woy = 0; constexpr auto max_dist = (uint32_t)(Vector2i(Math::abs(wcx)+1, Math::abs(wcy)+1)*TILE_MAX_DIM*iTILE_SIZE2).length(); -- cgit v1.2.3