From f6254da44552dfc0c2b98dcfbd9f3b846976d235 Mon Sep 17 00:00:00 2001 From: Ian Lance Taylor Date: Fri, 11 Feb 2005 15:07:33 +0000 Subject: tree.c (build_function_type_list): Work correctly if there are no arguments. * tree.c (build_function_type_list): Work correctly if there are no arguments. From-SVN: r94878 --- gcc/tree.c | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) (limited to 'gcc/tree.c') diff --git a/gcc/tree.c b/gcc/tree.c index 1865943..3d41e11 100644 --- a/gcc/tree.c +++ b/gcc/tree.c @@ -4538,9 +4538,14 @@ build_function_type_list (tree return_type, ...) for (args = NULL_TREE; t != NULL_TREE; t = va_arg (p, tree)) args = tree_cons (NULL_TREE, t, args); - last = args; - args = nreverse (args); - TREE_CHAIN (last) = void_list_node; + if (args == NULL_TREE) + args = void_list_node; + else + { + last = args; + args = nreverse (args); + TREE_CHAIN (last) = void_list_node; + } args = build_function_type (return_type, args); va_end (p); -- cgit v1.1