summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAlex Orlenko <zxteam@protonmail.com>2022-12-03 17:55:26 +0000
committerAlex Orlenko <zxteam@protonmail.com>2022-12-03 17:55:26 +0000
commit6e95386f30f2c7d20ae1158b907cd0ab8b9a1924 (patch)
tree8a9d9fbf26492cd2a04f1d0ffcdb06bd70233050
parent6807dfa22e5ef787b92461796d6b91360baf00a6 (diff)
downloadmlua-6e95386f30f2c7d20ae1158b907cd0ab8b9a1924.zip
Update Luau to 0.555 (luau-src 0.5.0)
This version includes inreased LUAI_MAXCSTACK limit (100000)
-rw-r--r--Cargo.toml2
-rw-r--r--src/ffi/luau/lua.rs9
2 files changed, 7 insertions, 4 deletions
diff --git a/Cargo.toml b/Cargo.toml
index b048f7f..c228275 100644
--- a/Cargo.toml
+++ b/Cargo.toml
@@ -58,7 +58,7 @@ cc = { version = "1.0" }
pkg-config = { version = "0.3.17" }
lua-src = { version = ">= 544.0.0, < 550.0.0", optional = true }
luajit-src = { version = ">= 210.4.0, < 220.0.0", optional = true }
-luau0-src = { version = "0.4.0", optional = true }
+luau0-src = { version = "0.5.0", optional = true }
[dev-dependencies]
rustyline = "10.0"
diff --git a/src/ffi/luau/lua.rs b/src/ffi/luau/lua.rs
index 624e427..22391ef 100644
--- a/src/ffi/luau/lua.rs
+++ b/src/ffi/luau/lua.rs
@@ -7,12 +7,15 @@ use std::ptr;
// Option for multiple returns in 'lua_pcall' and 'lua_call'
pub const LUA_MULTRET: c_int = -1;
+// Max number of Lua stack slots
+const LUAI_MAXCSTACK: c_int = 100000;
+
//
// Pseudo-indices
//
-pub const LUA_REGISTRYINDEX: c_int = -10000;
-pub const LUA_ENVIRONINDEX: c_int = -10001;
-pub const LUA_GLOBALSINDEX: c_int = -10002;
+pub const LUA_REGISTRYINDEX: c_int = -LUAI_MAXCSTACK - 2000;
+pub const LUA_ENVIRONINDEX: c_int = -LUAI_MAXCSTACK - 2001;
+pub const LUA_GLOBALSINDEX: c_int = -LUAI_MAXCSTACK - 2002;
pub const fn lua_upvalueindex(i: c_int) -> c_int {
LUA_GLOBALSINDEX - i