diff --git a/tools/qfcc/include/def.h b/tools/qfcc/include/def.h index 6ecb5aae8..6892b5d8a 100644 --- a/tools/qfcc/include/def.h +++ b/tools/qfcc/include/def.h @@ -221,6 +221,9 @@ void free_temp_def (def_t *temp); */ void def_to_ddef (def_t *def, ddef_t *ddef, int aux); +void init_vector_components (struct symbol_s *vector_sym, int is_field, + struct symtab_s *symtab); + /** Initialize a def referenced by the given symbol. The symbol is checked for redefinition. A symbol is considered to be diff --git a/tools/qfcc/source/def.c b/tools/qfcc/source/def.c index 849723a44..29214b5c3 100644 --- a/tools/qfcc/source/def.c +++ b/tools/qfcc/source/def.c @@ -412,7 +412,7 @@ init_elements (struct def_s *def, expr_t *eles) free_element_chain (&element_chain); } -static void +void init_vector_components (symbol_t *vector_sym, int is_field, symtab_t *symtab) { expr_t *vector_expr; diff --git a/tools/qfcc/source/function.c b/tools/qfcc/source/function.c index c2381d93b..0c1d8b680 100644 --- a/tools/qfcc/source/function.c +++ b/tools/qfcc/source/function.c @@ -542,6 +542,8 @@ create_param (symtab_t *parameters, symbol_t *param) param->s.def = def; param->sy_type = sy_var; symtab_addsymbol (parameters, param); + if (is_vector(param->type) && options.code.vector_components) + init_vector_components (param, 0, parameters); } static void