Use correct regexp syntax in ARM PR20068 test
[deliverable/binutils-gdb.git] / gas / macro.c
index b083382704aa101860696144f4c8f689a0d022e2..615bfdae4fdd137a210ed7a8325cffa29f7b16ca 100644 (file)
@@ -471,7 +471,7 @@ new_formal (void)
 {
   formal_entry *formal;
 
-  formal = (formal_entry *) xmalloc (sizeof (formal_entry));
+  formal = XNEW (formal_entry);
 
   sb_new (&formal->name);
   sb_new (&formal->def);
@@ -655,7 +655,7 @@ define_macro (size_t idx, sb *in, sb *label,
   sb name;
   const char *error = NULL;
 
-  macro = (macro_entry *) xmalloc (sizeof (macro_entry));
+  macro = XNEW (macro_entry);
   sb_new (&macro->sub);
   sb_new (&name);
   macro->file = file;
@@ -1250,13 +1250,14 @@ check_macro (const char *line, sb *expand,
   if (is_name_ender (*s))
     ++s;
 
-  copy = (char *) alloca (s - line + 1);
+  copy = (char *) xmalloc (s - line + 1);
   memcpy (copy, line, s - line);
   copy[s - line] = '\0';
   for (cls = copy; *cls != '\0'; cls ++)
     *cls = TOLOWER (*cls);
 
   macro = (macro_entry *) hash_find (macro_hash, copy);
+  free (copy);
 
   if (macro == NULL)
     return 0;
@@ -1288,7 +1289,7 @@ delete_macro (const char *name)
   macro_entry *macro;
 
   len = strlen (name);
-  copy = (char *) alloca (len + 1);
+  copy = (char *) xmalloc (len + 1);
   for (i = 0; i < len; ++i)
     copy[i] = TOLOWER (name[i]);
   copy[i] = '\0';
@@ -1303,6 +1304,7 @@ delete_macro (const char *name)
     }
   else
     as_warn (_("Attempt to purge non-existant macro `%s'"), copy);
+  free (copy);
 }
 
 /* Handle the MRI IRP and IRPC pseudo-ops.  These are handled as a
This page took 0.024331 seconds and 4 git commands to generate.