Make Address a int64 if <virtual_address> is included (#2407)

This commit is contained in:
Benoist
2026-03-12 21:02:12 +01:00
committed by GitHub
parent 2e395c6787
commit 2b5554a21d
24 changed files with 224 additions and 300 deletions
+14 -5
View File
@@ -295,14 +295,16 @@ DataStatus EncodeValveParam(IPluginContext *pContext,
}
case Valve_VirtualAddress:
{
cell_t *addr;
pContext->LocalToPhysAddr(param, &addr);
if (data->flags & PASSFLAG_ASPOINTER)
{
buffer = *(void **)buffer;
}
*addr = g_pSM->ToPseudoAddress(*(void**)buffer);
cell_t* sp_addr;
if (pContext->LocalToPhysAddr(param, &sp_addr) != SP_ERROR_NONE) {
return Data_Fail;
}
*reinterpret_cast<int64_t*>(sp_addr) = reinterpret_cast<intptr_t>(*(void**)buffer);
return Data_Okay;
}
@@ -626,7 +628,14 @@ DataStatus DecodeValveParam(IPluginContext *pContext,
*(void **)buffer = (unsigned char *)_buffer + pCall->stackEnd + data->obj_offset;
buffer = *(void **)buffer;
}
void* addr = g_pSM->FromPseudoAddress(param);
cell_t* sp_addr;
if (pContext->LocalToPhysAddr(param, &sp_addr) != SP_ERROR_NONE) {
return Data_Fail;
}
void* addr = (void*)(*reinterpret_cast<int64_t*>(sp_addr));
if (addr == nullptr && (data->decflags & VDECODE_FLAG_ALLOWNULL) == 0)
{
pContext->ThrowNativeError("NULL Address not allowed");