We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 646827a commit 72f6536Copy full SHA for 72f6536
src/util/mod.rs
@@ -88,7 +88,7 @@ impl Drop for StackGuard {
88
#[inline(always)]
89
pub(crate) unsafe fn push_string(state: *mut ffi::lua_State, s: &[u8], protect: bool) -> Result<()> {
90
// Always use protected mode if the string is too long
91
- if protect || s.len() >(1 << 30) {
+ if protect || s.len() >= const{1 << 30} {
92
protect_lua!(state, 0, 1, |state| {
93
ffi::lua_pushlstring(state, s.as_ptr() as *const c_char, s.len());
94
})
@@ -122,7 +122,7 @@ pub(crate) unsafe fn push_table(
122
) -> Result<()> {
123
let narr: c_int = narr.try_into().unwrap_or(c_int::MAX);
124
let nrec: c_int = nrec.try_into().unwrap_or(c_int::MAX);
125
- if protect {
+ if protect || narr >= const{1 << 30} || nrec >= const{1 << 27}{
126
protect_lua!(state, 0, 1, |state| ffi::lua_createtable(state, narr, nrec))
127
} else {
128
ffi::lua_createtable(state, narr, nrec);
AltStyle によって変換されたページ (->オリジナル) / アドレス: モード: デフォルト 音声ブラウザ ルビ付き 配色反転 文字拡大 モバイル
0 commit comments