Skip to content
Permalink
Browse files

Fix virtual SDKCall with object params (#1104)

PR #705 made some changes for 64-bit support that required callers to
provide a buffer for object storage, but only added the required code to
the non-virtual call builder, not the virtual call builder.

Copy it over to CreateValveVCall so that ValveParamToBinParam stops
writing to a null pointer.

Fixes #1059 (Hopefully.)
  • Loading branch information
asherkin committed Oct 17, 2019
1 parent 024ae2b commit 77f4ddf2c2912436769b3073c0ac8e1b04c7f50f
Showing with 4 additions and 0 deletions.
  1. +4 −0 extensions/sdktools/vcallbuilder.cpp
@@ -255,10 +255,12 @@ ValveCall *CreateValveVCall(unsigned int vtableIdx,

/* Get return information - encode only */
PassInfo retBuf;
ObjectField retFieldBuf[16];
size_t retBufSize = 0;
bool retbuf_needs_extra;
if (retInfo)
{
retBuf.fields = retFieldBuf;
if ((size = ValveParamToBinParam(retInfo->vtype, retInfo->type, retInfo->flags, &retBuf, retbuf_needs_extra)) == 0)
{
delete vc;
@@ -269,12 +271,14 @@ ValveCall *CreateValveVCall(unsigned int vtableIdx,

/* Get parameter info */
PassInfo paramBuf[32];
ObjectField fieldBuf[32][16];
size_t sizes[32];
size_t normSize = 0;
size_t extraSize = 0;
for (unsigned int i=0; i<numParams; i++)
{
bool needs_extra;
paramBuf[i].fields = fieldBuf[i];
if ((size = ValveParamToBinParam(params[i].vtype,
params[i].type,
params[i].flags,

0 comments on commit 77f4ddf

Please sign in to comment.
You can’t perform that action at this time.