File tree Expand file tree Collapse file tree 1 file changed +3
-2
lines changed
Expand file tree Collapse file tree 1 file changed +3
-2
lines changed Original file line number Diff line number Diff line change @@ -354,7 +354,7 @@ unsafe fn init_userdata_metatable_index(state: *mut ffi::lua_State) -> Result<()
354354 end
355355 "# ;
356356 protect_lua ! ( state, 0 , 1 , |state| {
357- let ret = ffi:: luaL_loadbuffer( state, code. as_ptr( ) , code. count_bytes( ) , cstr!( "__mlua_index" ) ) ;
357+ let ret = ffi:: luaL_loadbuffer( state, code. as_ptr( ) , code. count_bytes( ) , cstr!( "= __mlua_index" ) ) ;
358358 if ret != ffi:: LUA_OK {
359359 ffi:: lua_error( state) ;
360360 }
@@ -405,7 +405,8 @@ unsafe fn init_userdata_metatable_newindex(state: *mut ffi::lua_State) -> Result
405405 end
406406 "# ;
407407 protect_lua ! ( state, 0 , 1 , |state| {
408- let ret = ffi:: luaL_loadbuffer( state, code. as_ptr( ) , code. count_bytes( ) , cstr!( "__mlua_newindex" ) ) ;
408+ let code_len = code. count_bytes( ) ;
409+ let ret = ffi:: luaL_loadbuffer( state, code. as_ptr( ) , code_len, cstr!( "=__mlua_newindex" ) ) ;
409410 if ret != ffi:: LUA_OK {
410411 ffi:: lua_error( state) ;
411412 }
You can’t perform that action at this time.
0 commit comments