File tree 3 files changed +4
-3
lines changed
3 files changed +4
-3
lines changed Original file line number Diff line number Diff line change @@ -21,6 +21,7 @@ default = ["builtin-lua"]
21
21
# * LUA_INTEGER is long long
22
22
# * LUA_NUMBER as double
23
23
# * LUA_EXTRASPACE is sizeof(void*)
24
+ # * LUAI_MAXSTACK is 1000000
24
25
builtin-lua = [" gcc" ]
25
26
26
27
[dependencies ]
Original file line number Diff line number Diff line change @@ -34,6 +34,8 @@ pub const LUAI_MAXSTACK: c_int = 1_000_000;
34
34
pub const LUA_REGISTRYINDEX : c_int = -LUAI_MAXSTACK - 1000 ;
35
35
pub const LUA_RIDX_MAINTHREAD : lua_Integer = 1 ;
36
36
pub const LUA_RIDX_GLOBALS : lua_Integer = 2 ;
37
+ // Not actually defined in lua.h / luaconf.h
38
+ pub const LUA_MAX_UPVALUES : c_int = 255 ;
37
39
38
40
pub const LUA_TNONE : c_int = -1 ;
39
41
pub const LUA_TNIL : c_int = 0 ;
Original file line number Diff line number Diff line change @@ -146,12 +146,10 @@ impl<'lua> Function<'lua> {
146
146
let lua = self . 0 . lua ;
147
147
unsafe {
148
148
stack_err_guard ( lua. state , 0 , || {
149
- const MAX_LUA_UPVALUES : c_int = 255 ;
150
-
151
149
let args = args. to_lua_multi ( lua) ?;
152
150
let nargs = args. len ( ) as c_int ;
153
151
154
- if nargs + 2 > MAX_LUA_UPVALUES {
152
+ if nargs + 2 > ffi :: LUA_MAX_UPVALUES {
155
153
return Err ( Error :: BindError ) ;
156
154
}
157
155
You can’t perform that action at this time.
0 commit comments