From 62cc770a6675526d3ab8388ec39fde3087047dab Mon Sep 17 00:00:00 2001 From: rguenth Date: Thu, 14 Aug 2014 13:13:41 +0000 Subject: 2014-08-14 Richard Biener PR lto/62067 * lto-lang.c (def_fn_type): Fix error handling wrt va_end. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@213960 138bc75d-0d04-0410-961f-82ee72b054a4 --- gcc/lto/lto-lang.c | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) (limited to 'gcc/lto/lto-lang.c') diff --git a/gcc/lto/lto-lang.c b/gcc/lto/lto-lang.c index b3b9ff7caf7..9e8524acac2 100644 --- a/gcc/lto/lto-lang.c +++ b/gcc/lto/lto-lang.c @@ -524,6 +524,7 @@ def_fn_type (builtin_type def, builtin_type ret, bool var, int n, ...) tree *args = XALLOCAVEC (tree, n); va_list list; int i; + bool err = false; va_start (list, n); for (i = 0; i < n; ++i) @@ -531,22 +532,22 @@ def_fn_type (builtin_type def, builtin_type ret, bool var, int n, ...) builtin_type a = (builtin_type) va_arg (list, int); t = builtin_types[a]; if (t == error_mark_node) - goto egress; + err = true; args[i] = t; } va_end (list); t = builtin_types[ret]; + if (err) + t = error_mark_node; if (t == error_mark_node) - goto egress; - if (var) + ; + else if (var) t = build_varargs_function_type_array (t, n, args); else t = build_function_type_array (t, n, args); - egress: builtin_types[def] = t; - va_end (list); } /* Used to help initialize the builtin-types.def table. When a type of -- cgit v1.2.1