[qfcc] Fix some source location tracking

This commit is contained in:
Bill Currie 2025-02-17 15:13:37 +09:00
parent 71e6ff78c7
commit 5acca56d8d
2 changed files with 2 additions and 1 deletions

View file

@ -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);

View file

@ -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);
}