[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:
Bill Currie 2023-09-11 00:32:01 +09:00
parent 2d7b5c18af
commit 4bcbfc3473

View file

@ -819,7 +819,7 @@ build_code_function (symbol_t *fsym, expr_t *state_expr, expr_t *statements)
STACK_ALIGN);
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) {
st->b = -func->params_start;
} else {