Skip to content

Commit

Permalink
移除非安全内存访问函数中的内存检查
Browse files Browse the repository at this point in the history
  • Loading branch information
HalcyonAlcedo committed Oct 25, 2024
1 parent eafb46e commit 53ca7c5
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/lua/lua_register.h
Original file line number Diff line number Diff line change
Expand Up @@ -324,7 +324,7 @@ static int System_Memory_GetAddress(lua_State* pL) {
vector<int> bytes;
uintptr_t ptr = (uintptr_t)lua_tointeger(pL, 1);

if (ptr == 0 || !utils::IsMemoryReadable((void*)ptr, sizeof(ptr))) {
if (ptr == 0) {
lua_pushboolean(pL, false);
return 1;
}
Expand All @@ -351,7 +351,7 @@ static int System_Memory_GetAddressData(lua_State* pL) {
uintptr_t ptr = (uintptr_t)lua_tointeger(pL, 1);
string type = (string)lua_tostring(pL, 2);

if (ptr == 0 || !utils::IsMemoryReadable((void*)ptr, sizeof(ptr))) {
if (ptr == 0) {
lua_pushboolean(pL, false);
return 1;
}
Expand Down Expand Up @@ -382,7 +382,7 @@ static int System_Memory_SetAddressData(lua_State* pL) {
uintptr_t ptr = (uintptr_t)lua_tointeger(pL, 1);
string type = (string)lua_tostring(pL, 2);

if (ptr == 0 || !utils::IsMemoryReadable((void*)ptr, sizeof(ptr))) {
if (ptr == 0) {
lua_pushboolean(pL, false);
return 1;
}
Expand Down

0 comments on commit 53ca7c5

Please sign in to comment.