Re: Possible bug in plpgsql/src/gram.y

From: Bruce Momjian <pgman(at)candle(dot)pha(dot)pa(dot)us>
To: Ian Lance Taylor <ian(at)airs(dot)com>
Cc: pgsql-hackers(at)postgresql(dot)org
Subject: Re: Possible bug in plpgsql/src/gram.y
Date: 2001-07-12 01:19:59
Message-ID: 200107120119.f6C1Jxt11746@candle.pha.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers


Also, can someone tell my why we use malloc in plpgsql?

> In this bit of code in src/pl/plpgsql/src/gram.y in the current CVS
> sources, curname_def is defined as PLpgSQL_expr * but it is is
> allocated the space required for a PLpgSQL_var. This looks like a
> bug.
>
> Ian
>
> | decl_varname K_CURSOR decl_cursor_args decl_is_from K_SELECT decl_cursor_query
> {
> PLpgSQL_var *new;
> PLpgSQL_expr *curname_def;
> char buf[1024];
> char *cp1;
> char *cp2;
>
> plpgsql_ns_pop();
>
> new = malloc(sizeof(PLpgSQL_var));
> memset(new, 0, sizeof(PLpgSQL_var));
>
> curname_def = malloc(sizeof(PLpgSQL_var));
> memset(curname_def, 0, sizeof(PLpgSQL_var));
>
> ---------------------------(end of broadcast)---------------------------
> TIP 3: if posting/reading through Usenet, please send an appropriate
> subscribe-nomail command to majordomo(at)postgresql(dot)org so that your
> message can get through to the mailing list cleanly
>

--
Bruce Momjian | http://candle.pha.pa.us
pgman(at)candle(dot)pha(dot)pa(dot)us | (610) 853-3000
+ If your life is a hard drive, | 830 Blythe Avenue
+ Christ can be your backup. | Drexel Hill, Pennsylvania 19026

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Tatsuo Ishii 2001-07-12 01:58:18 Re: docs Japanese translation
Previous Message Bruce Momjian 2001-07-12 01:18:44 Re: Possible bug in plpgsql/src/gram.y