Commit ec7806db authored by Michael Meskes's avatar Michael Meskes

Fixed bug in parsing of typedef'ed array sizes.

Synced parser.
parent b3f3092c
...@@ -1877,6 +1877,11 @@ Mon Oct 18 15:34:51 CEST 2004 ...@@ -1877,6 +1877,11 @@ Mon Oct 18 15:34:51 CEST 2004
Wed Nov 10 14:43:50 CET 2004 Wed Nov 10 14:43:50 CET 2004
- List VALUE as a keyword. - List VALUE as a keyword.
Mon Dec 6 21:27:34 CET 2004
- Fixed bug in parsing of typedef'ed array sizes.
- Synced parser.
- Set ecpg version to 3.2.0. - Set ecpg version to 3.2.0.
- Set compat library version to 1.2. - Set compat library version to 1.2.
- Set ecpg library version to 4.2. - Set ecpg library version to 4.2.
......
/* $PostgreSQL: pgsql/src/interfaces/ecpg/preproc/preproc.y,v 1.301 2004/11/10 13:48:10 meskes Exp $ */ /* $PostgreSQL: pgsql/src/interfaces/ecpg/preproc/preproc.y,v 1.302 2004/12/06 20:35:35 meskes Exp $ */
/* Copyright comment */ /* Copyright comment */
%{ %{
...@@ -1955,12 +1955,8 @@ any_name: ColId { $$ = $1; } ...@@ -1955,12 +1955,8 @@ any_name: ColId { $$ = $1; }
| ColId attrs { $$ = cat2_str($1, $2); } | ColId attrs { $$ = cat2_str($1, $2); }
; ;
/*
* The slightly convoluted way of writing this production avoids reduce/reduce
* errors against indirection_el.
*/
attrs: '.' attr_name { $$ = cat2_str(make_str("."), $2); } attrs: '.' attr_name { $$ = cat2_str(make_str("."), $2); }
| '.' attr_name attrs { $$ = cat_str(3, make_str("."), $2, $3); } | attrs '.' attr_name { $$ = cat_str(3, $1, make_str("."), $3); }
; ;
/***************************************************************************** /*****************************************************************************
...@@ -4167,7 +4163,7 @@ qualified_name_list: qualified_name ...@@ -4167,7 +4163,7 @@ qualified_name_list: qualified_name
qualified_name: relation_name qualified_name: relation_name
{ $$ = $1; } { $$ = $1; }
| relation_name attrs | relation_name indirection
{ $$ = cat2_str($1, $2); } { $$ = cat2_str($1, $2); }
; ;
......
...@@ -365,7 +365,7 @@ ECPGdump_a_simple(FILE *o, const char *name, enum ECPGttype type, ...@@ -365,7 +365,7 @@ ECPGdump_a_simple(FILE *o, const char *name, enum ECPGttype type,
else else
sprintf(variable, "&(%s%s)", prefix ? prefix : "", name); sprintf(variable, "&(%s%s)", prefix ? prefix : "", name);
sprintf(offset, "%s*sizeof(char)", strcmp(varcharsize, "0") == 0 ? "1" : varcharsize); sprintf(offset, "(%s)*sizeof(char)", strcmp(varcharsize, "0") == 0 ? "1" : varcharsize);
break; break;
case ECPGt_numeric: case ECPGt_numeric:
......
...@@ -560,7 +560,7 @@ adjust_array(enum ECPGttype type_enum, char **dimension, char **length, char *ty ...@@ -560,7 +560,7 @@ adjust_array(enum ECPGttype type_enum, char **dimension, char **length, char *ty
* changed later on when the variable is defined * changed later on when the variable is defined
*/ */
*length = make_str("1"); *length = make_str("1");
else if (atoi(*dimension) == 0) else if (strcmp(*dimension, "0") == 0)
*length = make_str("-1"); *length = make_str("-1");
else else
*length = *dimension; *length = *dimension;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment