Commit d6272e45 by Richard Stallman

(check_format): Don't crash if cur_type is an error_mark.

Handle identifier_node as the TYPE_NAME.

From-SVN: r4682
parent 4ab08223
......@@ -1794,12 +1794,18 @@ check_format (info, params)
this = IDENTIFIER_POINTER (DECL_NAME (TYPE_NAME (wanted_type)));
that = 0;
if (TYPE_NAME (cur_type) != 0
if (TREE_CODE (cur_type) != ERROR_MARK
&& TYPE_NAME (cur_type) != 0
&& TREE_CODE (cur_type) != INTEGER_TYPE
&& !(TREE_CODE (cur_type) == POINTER_TYPE
&& TREE_CODE (TREE_TYPE (cur_type)) == INTEGER_TYPE)
&& DECL_NAME (TYPE_NAME (cur_type)) != 0)
that = IDENTIFIER_POINTER (DECL_NAME (TYPE_NAME (cur_type)));
&& TREE_CODE (TREE_TYPE (cur_type)) == INTEGER_TYPE))
{
if (TREE_CODE (TYPE_NAME (cur_type)) == TYPE_DECL
&& DECL_NAME (TYPE_NAME (cur_type)) != 0)
that = IDENTIFIER_POINTER (DECL_NAME (TYPE_NAME (cur_type)));
else
that = IDENTIFIER_POINTER (TYPE_NAME (cur_type));
}
/* A nameless type can't possibly match what the format wants.
So there will be a warning for it.
......
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