This is the mail archive of the gcc-bugs@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

Your change to build_method_call breaks g++


Hi,

Your change to build_method_call in call.c left TMP around line 649
uninitialized in some cases:

  if (TREE_CODE (name) == BIT_NOT_EXPR)
    {
      tree tmp;

      flags |= LOOKUP_DESTRUCTOR;
      name = TREE_OPERAND (name, 0);
      if (parms)
	error ("destructors take no parameters");
      basetype = TREE_TYPE (instance);
      if (TREE_CODE (basetype) == REFERENCE_TYPE)
	basetype = TREE_TYPE (basetype);

      if (TREE_CODE (name) == TYPE_DECL)
	tmp = TREE_TYPE (name);
      else if (TREE_CODE_CLASS (TREE_CODE (name)) == 't')
	tmp = name;
      else if (TREE_CODE (name) == IDENTIFIER_NODE)
	{
	  if (IS_AGGR_TYPE (basetype) && tmp == constructor_name (basetype))
	    tmp = basetype;
	  else
	    tmp = get_type_value (tmp);
	}
      else
	my_friendly_abort (980605);

As you can see, tmp has some random value in

	  if (IS_AGGR_TYPE (basetype) && tmp == constructor_name (basetype))

H.J.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]