Commit 57f10fe5 by Jim Meyering Committed by Jim Meyering

genattrtab: avoid NULL-deref on error

* genattrtab.c (gen_attr): Avoid NULL-deref after diagnosing
absence of an define_enum call.

From-SVN: r186761
parent 7d5a99f4
2012-02-24 Jim Meyering <meyering@redhat.com>
* genattrtab.c (gen_attr): Avoid NULL-deref after diagnosing
absence of an define_enum call.
2012-04-24 Richard Guenther <rguenther@suse.de>
* tree-vect-loop-manip.c (vect_do_peeling_for_loop_bound): If
......
/* Generate code from machine description to compute values of attributes.
Copyright (C) 1991, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000,
2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010
2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2012
Free Software Foundation, Inc.
Contributed by Richard Kenner (kenner@vlsi1.ultra.nyu.edu)
......@@ -2993,8 +2993,9 @@ gen_attr (rtx exp, int lineno)
if (!et || !et->md_p)
error_with_line (lineno, "No define_enum called `%s' defined",
attr->name);
for (ev = et->values; ev; ev = ev->next)
add_attr_value (attr, ev->name);
if (et)
for (ev = et->values; ev; ev = ev->next)
add_attr_value (attr, ev->name);
}
else if (*XSTR (exp, 1) == '\0')
attr->is_numeric = 1;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment