From 882d0f25ce17eb7fae99915afd53d5d78b163373 Mon Sep 17 00:00:00 2001 From: Bill Currie Date: Fri, 30 Aug 2002 05:33:34 +0000 Subject: [PATCH] the code memory block can move around so take the address of a statement after statments have been emitted, not before. --- tools/qfcc/source/emit.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/tools/qfcc/source/emit.c b/tools/qfcc/source/emit.c index e06ba72f9..e715bfa77 100644 --- a/tools/qfcc/source/emit.c +++ b/tools/qfcc/source/emit.c @@ -177,8 +177,9 @@ emit_branch (expr_t *_e, opcode_t *op, expr_t *e, expr_t *l) if (e) def = emit_sub_expr (e, 0); - st = &pr.code->code[ofs = pr.code->size]; + ofs = pr.code->size; emit_statement (_e, op, def, 0, 0); + st = &pr.code->code[ofs]; if (l->e.label.ofs) { if (op == op_goto) st->a = l->e.label.ofs - ofs;