summaryrefslogtreecommitdiff
path: root/gcc/tree.c
diff options
context:
space:
mode:
authorian <ian@138bc75d-0d04-0410-961f-82ee72b054a4>2005-02-11 15:07:33 +0000
committerian <ian@138bc75d-0d04-0410-961f-82ee72b054a4>2005-02-11 15:07:33 +0000
commitbaf63f2456555c60fd172473c31080f1125f7c3c (patch)
treedb77a289904a26477d9aa92996652cc67a7b01e3 /gcc/tree.c
parent4e70b35e424b98b06cc013ce19b16f4394056252 (diff)
downloadgcc-baf63f2456555c60fd172473c31080f1125f7c3c.tar.gz
* tree.c (build_function_type_list): Work correctly if there are
no arguments. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@94878 138bc75d-0d04-0410-961f-82ee72b054a4
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 186594375c7..3d41e114342 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);