From 548b7fe75359031784c53319a612457356707670 Mon Sep 17 00:00:00 2001 From: Bill Currie Date: Sun, 6 Feb 2022 20:14:52 +0900 Subject: [PATCH] [qfcc] Set function file and line when building code I suspect this is an ancient bug that wasn't noticed due to not looking at progs.src compiled code enough, but it makes the first statements of the function point to the correct line instead of a forward declaration. --- tools/qfcc/source/function.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/tools/qfcc/source/function.c b/tools/qfcc/source/function.c index 0c1d8b680..e9371ea81 100644 --- a/tools/qfcc/source/function.c +++ b/tools/qfcc/source/function.c @@ -675,6 +675,9 @@ begin_function (symbol_t *sym, const char *nicename, symtab_t *parent, sym->s.func->def->nosave = 1; add_function (sym->s.func); reloc_def_func (sym->s.func, sym->s.func->def); + + sym->s.func->def->file = pr.source_file; + sym->s.func->def->line = pr.source_line; } sym->s.func->code = pr.code->size;