mirror of
https://git.code.sf.net/p/quake/quakeforge
synced 2024-11-10 15:22:04 +00:00
[gamecode] Replace lost parameter auto-reset
rcallN messes with the progs parameter pointers and not resetting them can cause incorrect data to be copied into the called function.
This commit is contained in:
parent
afd31ed292
commit
023a920a51
1 changed files with 3 additions and 0 deletions
|
@ -199,6 +199,7 @@ PR_EnterFunction (progs_t *pr, bfunction_t *f)
|
|||
if (pr->pr_params[i] != pr->pr_real_params[i]) {
|
||||
copy_param (pr->pr_real_params[i], pr->pr_params[i],
|
||||
f->parm_size[i].size);
|
||||
pr->pr_params[i] = pr->pr_real_params[i];
|
||||
}
|
||||
}
|
||||
} else if (f->numparms < 0) {
|
||||
|
@ -210,6 +211,7 @@ PR_EnterFunction (progs_t *pr, bfunction_t *f)
|
|||
if (pr->pr_params[i] != pr->pr_real_params[i]) {
|
||||
copy_param (pr->pr_real_params[i], pr->pr_params[i],
|
||||
f->parm_size[i].size);
|
||||
pr->pr_params[i] = pr->pr_real_params[i];
|
||||
}
|
||||
}
|
||||
dparmsize_t parmsize = { pr->pr_param_size, pr->pr_param_alignment };
|
||||
|
@ -221,6 +223,7 @@ PR_EnterFunction (progs_t *pr, bfunction_t *f)
|
|||
if (pr->pr_params[i] != pr->pr_real_params[i]) {
|
||||
copy_param (pr->pr_real_params[i], pr->pr_params[i],
|
||||
parmsize.size);
|
||||
pr->pr_params[i] = pr->pr_real_params[i];
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue