diff options
author | Michael Meskes <meskes@postgresql.org> | 2013-11-25 15:11:39 +0100 |
---|---|---|
committer | Michael Meskes <meskes@postgresql.org> | 2013-11-25 15:11:39 +0100 |
commit | ef8b3b00b55ef1feedb352a8a26f94845b6437dc (patch) | |
tree | 4e903b65a462061b15606ab9db6a75de6121bd95 | |
parent | 559d535819908adfe2d2ca674fb8562bbd133cef (diff) | |
download | postgresql-ef8b3b00b55ef1feedb352a8a26f94845b6437dc.tar.gz postgresql-ef8b3b00b55ef1feedb352a8a26f94845b6437dc.zip |
Fix ecpg parsing of sizeof().
The last fix used the wrong non-terminal to define valid types.
-rw-r--r-- | src/interfaces/ecpg/preproc/ecpg.trailer | 28 |
1 files changed, 14 insertions, 14 deletions
diff --git a/src/interfaces/ecpg/preproc/ecpg.trailer b/src/interfaces/ecpg/preproc/ecpg.trailer index 6ef9f1ab9d8..da378ebd27e 100644 --- a/src/interfaces/ecpg/preproc/ecpg.trailer +++ b/src/interfaces/ecpg/preproc/ecpg.trailer @@ -1856,20 +1856,20 @@ DeallocateStmt: DEALLOCATE prepared_name { $$ = $2; } | DEALLOCATE PREPARE ALL { $$ = mm_strdup("all"); } ; -Iresult: Iconst { $$ = $1; } - | '(' Iresult ')' { $$ = cat_str(3, mm_strdup("("), $2, mm_strdup(")")); } - | Iresult '+' Iresult { $$ = cat_str(3, $1, mm_strdup("+"), $3); } - | Iresult '-' Iresult { $$ = cat_str(3, $1, mm_strdup("-"), $3); } - | Iresult '*' Iresult { $$ = cat_str(3, $1, mm_strdup("*"), $3); } - | Iresult '/' Iresult { $$ = cat_str(3, $1, mm_strdup("/"), $3); } - | Iresult '%' Iresult { $$ = cat_str(3, $1, mm_strdup("%"), $3); } - | ecpg_sconst { $$ = $1; } - | ColId { $$ = $1; } - | ColId '(' ColId ')' { if (pg_strcasecmp($1, "sizeof") != 0) - mmerror(PARSE_ERROR, ET_ERROR, "operator not allowed in variable definition"); - else - $$ = cat_str(4,$1, mm_strdup("("), $3, mm_strdup(")")); - } +Iresult: Iconst { $$ = $1; } + | '(' Iresult ')' { $$ = cat_str(3, mm_strdup("("), $2, mm_strdup(")")); } + | Iresult '+' Iresult { $$ = cat_str(3, $1, mm_strdup("+"), $3); } + | Iresult '-' Iresult { $$ = cat_str(3, $1, mm_strdup("-"), $3); } + | Iresult '*' Iresult { $$ = cat_str(3, $1, mm_strdup("*"), $3); } + | Iresult '/' Iresult { $$ = cat_str(3, $1, mm_strdup("/"), $3); } + | Iresult '%' Iresult { $$ = cat_str(3, $1, mm_strdup("%"), $3); } + | ecpg_sconst { $$ = $1; } + | ColId { $$ = $1; } + | ColId '(' var_type ')' { if (pg_strcasecmp($1, "sizeof") != 0) + mmerror(PARSE_ERROR, ET_ERROR, "operator not allowed in variable definition"); + else + $$ = cat_str(4, $1, mm_strdup("("), $3.type_str, mm_strdup(")")); + } ; execute_rest: /* EMPTY */ { $$ = EMPTY; } |