fix luajit::MatchMetaName()
This commit is contained in:
parent
4625cad8cc
commit
f39de1a8d5
@ -44,7 +44,8 @@ void PushGlobalTable(lua_State* L) noexcept {
|
||||
PushMutableVector(L, std::vector<uint8_t> {*mut});
|
||||
return 1;
|
||||
}
|
||||
return luaL_error(L, "expected nf7::Value::MutableVector or nf7::Value::Vector");
|
||||
PushMutableVector(L, {});
|
||||
return 1;
|
||||
});
|
||||
lua_setfield(L, -2, "nf7_MutableVector");
|
||||
}
|
||||
@ -165,6 +166,7 @@ void PushMutableVector(lua_State* L, std::vector<uint8_t>&& v) noexcept {
|
||||
});
|
||||
lua_setfield(L, -2, "__gc");
|
||||
}
|
||||
lua_setmetatable(L, -2);
|
||||
}
|
||||
|
||||
std::optional<nf7::Value> ToValue(lua_State* L, int idx) noexcept {
|
||||
|
@ -36,7 +36,9 @@ inline void PushWeakPtrDeleter(lua_State* L, const std::weak_ptr<T>& = {}) noexc
|
||||
}
|
||||
|
||||
inline bool MatchMetaName(lua_State* L, int idx, const char* type) noexcept {
|
||||
lua_getmetatable(L, idx);
|
||||
if (0 == lua_getmetatable(L, idx)) {
|
||||
return false;
|
||||
}
|
||||
luaL_getmetatable(L, type);
|
||||
const bool ret = lua_rawequal(L, -1, -2);
|
||||
lua_pop(L, 2);
|
||||
|
2
thirdparty/CMakeLists.txt
vendored
2
thirdparty/CMakeLists.txt
vendored
@ -167,7 +167,7 @@ target_sources(linalg.h
|
||||
|
||||
FetchContent_Declare(
|
||||
luajit
|
||||
URL "https://github.com/LuaJIT/LuaJIT/archive/1d7b5029c5ba36870d25c67524034d452b761d27.zip"
|
||||
URL "https://github.com/LuaJIT/LuaJIT/archive/e3bae12fc0461cfa7e4bef3dfed2dad372e5da8d.zip"
|
||||
)
|
||||
FetchContent_Populate(luajit)
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user