[ox/mc] Fix use of uncaptured var in lambda
This commit is contained in:
parent
8ddc8f40e5
commit
18ace3ceff
6
deps/ox/src/ox/mc/read.hpp
vendored
6
deps/ox/src/ox/mc/read.hpp
vendored
@ -249,16 +249,16 @@ constexpr Error MetalClawReaderTemplate<Reader>::field(const char*, HashMap<Stri
|
||||
auto &handler = *reader.interface();
|
||||
oxReturnError(handler.setTypeInfo("List", 0, {}, static_cast<std::size_t>(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));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user