summaryrefslogtreecommitdiff
path: root/gcc/genrecog.c
diff options
context:
space:
mode:
Diffstat (limited to 'gcc/genrecog.c')
-rw-r--r--gcc/genrecog.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/gcc/genrecog.c b/gcc/genrecog.c
index 2856fe67d8a..2224f8036fe 100644
--- a/gcc/genrecog.c
+++ b/gcc/genrecog.c
@@ -766,7 +766,7 @@ add_to_sequence (pattern, last, position, insn_type, top)
if (depth > max_depth)
max_depth = depth;
- subpos = (char *) alloca (depth + 2);
+ subpos = (char *) xmalloc (depth + 2);
strcpy (subpos, position);
subpos[depth + 1] = 0;
@@ -796,7 +796,7 @@ add_to_sequence (pattern, last, position, insn_type, top)
last, subpos, insn_type, 0);
last = &sub->success;
}
- return sub;
+ goto ret;
}
/* Else nothing special. */
@@ -1027,6 +1027,8 @@ add_to_sequence (pattern, last, position, insn_type, top)
if (this->tests == NULL)
abort ();
+ ret:
+ free (subpos);
return sub;
}