mirror of
https://git.code.sf.net/p/quake/quakeforge
synced 2024-11-10 23:32:09 +00:00
Fix a segfault when setting up the stack.
Yup, putting {}s around even single statements under flow control (if, etc) is a good idea. Wonder if there's a gcc warning for that...
This commit is contained in:
parent
6252faa069
commit
33cbc500e8
1 changed files with 4 additions and 3 deletions
|
@ -151,11 +151,12 @@ PR_ResolveGlobals (progs_t *pr)
|
||||||
}
|
}
|
||||||
if (!pr->globals.stack) {
|
if (!pr->globals.stack) {
|
||||||
if ((def = PR_FindGlobal (pr, ".stack"))
|
if ((def = PR_FindGlobal (pr, ".stack"))
|
||||||
|| (def = PR_FindGlobal (pr, "stack")))
|
|| (def = PR_FindGlobal (pr, "stack"))) {
|
||||||
pr->globals.stack = &G_POINTER (pr, def->ofs);
|
pr->globals.stack = &G_POINTER (pr, def->ofs);
|
||||||
// the stack is at the very end of the progs memory map
|
// the stack is at the very end of the progs memory map
|
||||||
*pr->globals.stack = pr->globals_size;
|
*pr->globals.stack = pr->globals_size;
|
||||||
}
|
}
|
||||||
|
}
|
||||||
if (pr->fields.nextthink == -1)
|
if (pr->fields.nextthink == -1)
|
||||||
if ((def = PR_FindField (pr, "nextthink")))
|
if ((def = PR_FindField (pr, "nextthink")))
|
||||||
pr->fields.nextthink = def->ofs;
|
pr->fields.nextthink = def->ofs;
|
||||||
|
|
Loading…
Reference in a new issue