Make Address a int64 if <virtual_address> is included (#2407)
This commit is contained in:
@@ -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");
|
||||
|
||||
Reference in New Issue
Block a user