On Thu, Dec 08, 2011 at 02:02:23PM -0800, Han Shen(沈涵) wrote:
> Hi, Jakub, thanks! Patches modified according to gnu coding standards. -Han
Not completely:
> +/* Helper routine to check if a record or union contains an array field. */
> +
> +static int record_or_union_type_has_array(tree tree_type)
This needs to be
static int
record_or_union_type_has_array (tree tree_type)
(function name at column 1, space before ( ).
> +{
> + tree fields = TYPE_FIELDS(tree_type);
Space before ( (in many places through the whole patch).
> + if (TREE_CODE(var) == VAR_DECL && !is_global_var(var)) {
if (...)
{
tree
> + tree var_type = TREE_TYPE(var);
> + gen_stack_protect_signal += (TREE_CODE(var_type) == ARRAY_TYPE) ||
> + (RECORD_OR_UNION_TYPE_P(var_type) &&
> + record_or_union_type_has_array(var_type));
|| and && go on the next line, you probably want
gen_stack_protect_signal
+= (TREE_CODE (var_type) == ARRAY_TYPE
|| (RECORD_OR_UNION_TYPE_P (var_type)
&& record_or_union_type_has_array (var_type)));
> + else if (flag_stack_protect == 3 &&
> + (gen_stack_protect_signal ||
> + cfun->calls_alloca || has_protected_decls))
Again.
Jakub