Commit c3fac866 by Richard Kenner

(field_decl_cmp): Rewritten to make sure that a null name always sorts

low against other names.

From-SVN: r10137
parent fc91b0d0
......@@ -5383,7 +5383,15 @@ static int
field_decl_cmp (x, y)
tree *x, *y;
{
return (long)DECL_NAME (*x) - (long)DECL_NAME (*y);
if (DECL_NAME (*x) == DECL_NAME (*y))
return 0;
if (DECL_NAME (*x) == NULL)
return -1;
if (DECL_NAME (*y) == NULL)
return 1;
if (DECL_NAME (*x) < DECL_NAME (*y))
return -1;
return 1;
}
/* Fill in the fields of a RECORD_TYPE or UNION_TYPE node, T.
......
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