mirror of
https://git.code.sf.net/p/quake/quakeforge
synced 2025-02-16 17:01:53 +00:00
[qfcc] Fix an uninitialized test
When the function is empty, not even a stack adjust instruction is emitted, so checking for one wound up accessing uninitialized memory.
This commit is contained in:
parent
2d7b5c18af
commit
4bcbfc3473
1 changed files with 1 additions and 1 deletions
|
@ -819,7 +819,7 @@ build_code_function (symbol_t *fsym, expr_t *state_expr, expr_t *statements)
|
||||||
STACK_ALIGN);
|
STACK_ALIGN);
|
||||||
|
|
||||||
dstatement_t *st = &pr.code->code[func->code];
|
dstatement_t *st = &pr.code->code[func->code];
|
||||||
if (st->op == OP_ADJSTK) {
|
if (pr.code->size > func->code && st->op == OP_ADJSTK) {
|
||||||
if (func->params_start) {
|
if (func->params_start) {
|
||||||
st->b = -func->params_start;
|
st->b = -func->params_start;
|
||||||
} else {
|
} else {
|
||||||
|
|
Loading…
Reference in a new issue