mirror of
https://git.code.sf.net/p/quake/quakeforge
synced 2025-01-31 05:00:35 +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 ((def = PR_FindGlobal (pr, ".stack"))
|
||||
|| (def = PR_FindGlobal (pr, "stack")))
|
||||
|| (def = PR_FindGlobal (pr, "stack"))) {
|
||||
pr->globals.stack = &G_POINTER (pr, def->ofs);
|
||||
// the stack is at the very end of the progs memory map
|
||||
*pr->globals.stack = pr->globals_size;
|
||||
}
|
||||
}
|
||||
if (pr->fields.nextthink == -1)
|
||||
if ((def = PR_FindField (pr, "nextthink")))
|
||||
pr->fields.nextthink = def->ofs;
|
||||
|
|
Loading…
Reference in a new issue