Tue Jun 10 19:43:49 CEST 2003
- Fixed several small bugs.
+
+Wed Jun 11 08:30:41 CEST 2003
+
+ - Make sure a variable is no longer referenced when it is removed.
+ - Fixed counting bug in parsing "->" operator.
- Set ecpg version to 2.12.0.
- Set ecpg library to 3.4.2.
- Set pgtypes library to 1.0.0
-/* $Header: /cvsroot/pgsql/src/interfaces/ecpg/preproc/Attic/preproc.y,v 1.229 2003/06/10 17:46:43 meskes Exp $ */
+/* $Header: /cvsroot/pgsql/src/interfaces/ecpg/preproc/Attic/preproc.y,v 1.230 2003/06/11 06:39:12 meskes Exp $ */
/* Copyright comment */
%{
struct inf_compat_val *next;
} *informix_val;
-void mm(void)
-{
- int i,j;
-
- i=1;
- j=i+1;
-}
-
/*
* Handle parsing errors and warnings
*/
struct cursor *ptr;
struct arguments *p;
- mm();
for (ptr = cur; ptr != NULL; ptr=ptr->next)
{
if (strcmp(ptr->name, $1) == 0)
this = (struct cursor *) mm_alloc(sizeof(struct cursor));
/* initial definition */
- mm();
this->next = cur;
this->name = $2;
this->connection = connection;
/* restore the name, we will need it later */
*next = c;
- return find_struct_member(name, end, p->type->u.element->u.members, p->brace_level);
+ return find_struct_member(name, ++end, p->type->u.element->u.members, p->brace_level);
}
else
{
{
if (p->brace_level >= brace_level)
{
+ /* is it still referenced by a cursor? */
+ struct cursor *ptr;
+
+ for (ptr = cur; ptr != NULL; ptr = ptr->next)
+ {
+ struct arguments *varptr, *prevvar;
+
+ for (varptr = prevvar = ptr->argsinsert; varptr != NULL; varptr = varptr->next)
+ {
+ if (p == varptr->variable)
+ {
+ /* remove from list */
+ if (varptr == ptr->argsinsert)
+ ptr->argsinsert = varptr->next;
+ else
+ prevvar->next = varptr->next;
+ }
+ }
+ for (varptr = ptr->argsresult; varptr != NULL; varptr = varptr->next)
+ {
+ if (p == varptr->variable)
+ {
+ /* remove from list */
+ if (varptr == ptr->argsresult)
+ ptr->argsresult = varptr->next;
+ else
+ prevvar->next = varptr->next;
+ }
+ }
+ }
+
/* remove it */
if (p == allvariables)
prev = allvariables = p->next;