From: Justin Seyster Date: Fri, 16 Apr 2010 01:37:25 +0000 (-0400) Subject: Fixed error in build_gcc_call(). X-Git-Tag: release-v1.0~107^2 X-Git-Url: https://git.fsl.cs.stonybrook.edu/?a=commitdiff_plain;h=cfba5b3366d866ced62a8d1736de3491f956d2db;p=interaspect.git Fixed error in build_gcc_call(). Building the argtype_list the wrong way resulted in a malformed list that caused build_function_type() to crash in some circumstances. --- diff --git a/src/aop-weave.c b/src/aop-weave.c index 550a5d4..831502d 100644 --- a/src/aop-weave.c +++ b/src/aop-weave.c @@ -89,7 +89,7 @@ build_gcc_call (const char *func_name, tree return_type, va_list argp) gimple func_call; arg_list = VEC_alloc (tree, heap, 2); - argtype_list = void_list_node; + argtype_list = NULL_TREE; while ((kind = va_arg (argp, enum aop_argkind)) != AOP_TERM_ARG) { @@ -119,6 +119,11 @@ build_gcc_call (const char *func_name, tree return_type, va_list argp) /* Using tree_cons builds the list backwards! Un-backwards it. */ argtype_list = nreverse (argtype_list); + /* The last element of an argument list should always be + void_list_node, to signify that it is not a varargs argument + list. */ + argtype_list = chainon (argtype_list, void_list_node); + func_type = build_function_type (return_type, argtype_list); func_decl = build_fn_decl (func_name, func_type); func_call = gimple_build_call_vec (func_decl, arg_list);