aboutsummaryrefslogtreecommitdiff
path: root/gcc/tree.c
diff options
context:
space:
mode:
authorIan Lance Taylor <ian@airs.com>2005-02-11 15:07:33 +0000
committerIan Lance Taylor <ian@gcc.gnu.org>2005-02-11 15:07:33 +0000
commitf6254da44552dfc0c2b98dcfbd9f3b846976d235 (patch)
treedb77a289904a26477d9aa92996652cc67a7b01e3 /gcc/tree.c
parentf4f41b4e377b196203a195837357504523da5b63 (diff)
downloadgcc-f6254da44552dfc0c2b98dcfbd9f3b846976d235.zip
gcc-f6254da44552dfc0c2b98dcfbd9f3b846976d235.tar.gz
gcc-f6254da44552dfc0c2b98dcfbd9f3b846976d235.tar.bz2
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
Diffstat (limited to 'gcc/tree.c')
-rw-r--r--gcc/tree.c11
1 files changed, 8 insertions, 3 deletions
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);