/* macro.c - macro support for gas
Copyright 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003,
- 2004, 2005, 2006, 2007, 2008 Free Software Foundation, Inc.
+ 2004, 2005, 2006, 2007, 2008, 2011 Free Software Foundation, Inc.
Written by Steve and Judy Chamberlain of Cygnus Support,
sac@cygnus.com
int more = get_line (ptr);
- if (to_len == 4 && strcasecmp(to, "ENDR") == 0)
+ if (to_len == 4 && strcasecmp (to, "ENDR") == 0)
{
from = NULL;
from_len = 0;
}
else
{
- char *br_buf = (char *) xmalloc(1);
+ char *br_buf = (char *) xmalloc (1);
char *in_br = br_buf;
*in_br = '\0';
&& in->ptr[idx] != tchar)
sb_add_char (out, in->ptr[idx++]);
if (idx == in->len)
- return idx;
+ {
+ free (br_buf);
+ return idx;
+ }
break;
case '(':
case '[':
--in_br;
else
{
- br_buf = (char *) xmalloc(strlen(in_br) + 2);
- strcpy(br_buf + 1, in_br);
- free(in_br);
+ br_buf = (char *) xmalloc (strlen (in_br) + 2);
+ strcpy (br_buf + 1, in_br);
+ free (in_br);
in_br = br_buf;
}
*in_br = tchar;
sb_add_char (out, tchar);
++idx;
}
- free(br_buf);
+ free (br_buf);
}
}
{
if (macro->formal_count)
--idx;
+ del_formal (formal); /* 'formal' goes out of scope. */
break;
}
idx = sb_skip_white (idx, in);