Fix bug where globals can be assigned invalid memory (bug 4643, r=ds).
This commit is contained in:
parent
d099febf7b
commit
a37e2ab26a
@ -2386,7 +2386,14 @@ static int nesting=0;
|
|||||||
assert(sc_status==statFIRST || arg[argidx].ident == 0 || arg[argidx].tags!=NULL);
|
assert(sc_status==statFIRST || arg[argidx].ident == 0 || arg[argidx].tags!=NULL);
|
||||||
switch (arg[argidx].ident) {
|
switch (arg[argidx].ident) {
|
||||||
case 0:
|
case 0:
|
||||||
|
/* On the first pass, we don't have all of the parameter info.
|
||||||
|
* However, use information must be marked anyway, otherwise vars
|
||||||
|
* declared previously will be omitted in the second pass. See
|
||||||
|
* SourceMod bug 4643.
|
||||||
|
*/
|
||||||
error(92); /* argument count mismatch */
|
error(92); /* argument count mismatch */
|
||||||
|
if (lval.sym)
|
||||||
|
markusage(lval.sym,uWRITTEN);
|
||||||
break;
|
break;
|
||||||
case iVARARGS:
|
case iVARARGS:
|
||||||
/* always pass by reference */
|
/* always pass by reference */
|
||||||
|
Loading…
Reference in New Issue
Block a user