From 18ace3ceffb1feb610050b4b78db90aca72ca4a6 Mon Sep 17 00:00:00 2001 From: Gary Talent Date: Mon, 13 Nov 2023 21:50:11 -0600 Subject: [PATCH] [ox/mc] Fix use of uncaptured var in lambda --- deps/ox/src/ox/mc/read.hpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/deps/ox/src/ox/mc/read.hpp b/deps/ox/src/ox/mc/read.hpp index d96e4d76..b2c01e7c 100644 --- a/deps/ox/src/ox/mc/read.hpp +++ b/deps/ox/src/ox/mc/read.hpp @@ -249,16 +249,16 @@ constexpr Error MetalClawReaderTemplate::field(const char*, HashMap(len))); // this loop body needs to be in a lambda because of the potential alloca call - constexpr auto loopBody = [](auto& handler) { + constexpr auto loopBody = [](auto& handler, auto &val) { oxRequire(keyLen, handler.stringLength(nullptr)); auto wkey = ox_malloca(keyLen + 1, char, 0); auto wkeyPtr = wkey.get(); oxReturnError(handler.fieldCString("", &wkeyPtr, keyLen + 1)); - oxReturnError(handler.field("", &val->operator[](wkey.get()))); + oxReturnError(handler.field("", &val.operator[](wkey.get()))); return OxError(0); }; for (std::size_t i = 0; i < len; ++i) { - oxReturnError(loopBody(handler)); + oxReturnError(loopBody(handler, *val)); } } }