From: Matthias Braun Date: Thu, 15 Nov 2007 10:34:18 +0000 (+0000) Subject: fix uninitialized variable breaking implicitely defined functions X-Git-Url: http://nsz.repo.hu/git/?a=commitdiff_plain;h=377cc851b30da15e985e1f2ad998ad984d598133;p=cparser fix uninitialized variable breaking implicitely defined functions [r18402] --- diff --git a/parser.c b/parser.c index 7d21c82..e042b89 100644 --- a/parser.c +++ b/parser.c @@ -530,6 +530,9 @@ static expression_t *create_implicit_cast(expression_t *expression, assert(expression->datatype != NULL); type_t *source_type = expression->datatype; + source_type = skip_typeref(source_type); + dest_type = skip_typeref(dest_type); + if(expression->datatype == dest_type) return expression; @@ -1958,7 +1961,8 @@ static expression_t *parse_float_const(void) static declaration_t *create_implicit_function(symbol_t *symbol, const source_position_t source_position) { - function_type_t *function_type = allocate_type_zero(sizeof(function_type)); + function_type_t *function_type + = allocate_type_zero(sizeof(function_type[0])); function_type->type.type = TYPE_FUNCTION; function_type->result_type = type_int;