From 5acca56d8dbfc1a01aafe3ecde7ff5e4544b815e Mon Sep 17 00:00:00 2001 From: Bill Currie Date: Mon, 17 Feb 2025 15:13:37 +0900 Subject: [PATCH] [qfcc] Fix some source location tracking --- tools/qfcc/source/expr_process.c | 2 +- tools/qfcc/source/target_spirv.c | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/tools/qfcc/source/expr_process.c b/tools/qfcc/source/expr_process.c index 5981df9ad..b1f5b9cea 100644 --- a/tools/qfcc/source/expr_process.c +++ b/tools/qfcc/source/expr_process.c @@ -393,6 +393,7 @@ proc_symbol (const expr_t *expr, rua_ctx_t *ctx) } sym = symtab_lookup (current_symtab, sym->name); if (sym) { + scoped_src_loc (expr); if (sym->is_constexpr) { return new_symbol_expr (sym); } @@ -402,7 +403,6 @@ proc_symbol (const expr_t *expr, rua_ctx_t *ctx) if (sym->sy_type == sy_convert) { return sym->convert.conv (sym, sym->convert.data); } - scoped_src_loc (expr); return new_symbol_expr (sym); } return error (expr, "undefined symbol `%s`", expr->symbol->name); diff --git a/tools/qfcc/source/target_spirv.c b/tools/qfcc/source/target_spirv.c index bfb883335..72419d418 100644 --- a/tools/qfcc/source/target_spirv.c +++ b/tools/qfcc/source/target_spirv.c @@ -1674,6 +1674,7 @@ spirv_access_chain (const expr_t *e, spirvctx_t *ctx, if (literal_ind || direct_ind) { ind_id[i] = index; } else { + scoped_src_loc (obj); auto ind = new_uint_expr (index); ind_id[i] = spirv_emit_expr (ind, ctx); }