This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: C++ PATCH: Avoid wild reads
- To: Mark Mitchell <mark at codesourcery dot com>
- Subject: Re: C++ PATCH: Avoid wild reads
- From: Nathan Sidwell <nathan at codesourcery dot com>
- Date: Thu, 11 Jan 2001 12:55:31 +0000
- CC: gcc-patches at gcc dot gnu dot org
- Organization: Codesourcery LLC
- References: <20010110120627O.mitchell@codesourcery.com>
Mark Mitchell wrote:
>
> Jeffrey Oldham figured out that we were touching uninitialized memory
> in instantiate_template:
>
> for (clone = TREE_CHAIN (gen_tmpl);
> clone && DECL_CLONED_FUNCTION_P (clone);
> clone = TREE_CHAIN (clone))
>
> Here, the clone can be something like a VAR_DECL that doesn't have a
> full lang_decl, and therefore DECL_CLONED_FUNCTION_P doesn't make
> sense.
This fixes bug 1551, which I was just about to bash on.
I've installed the attached testcase from bug 1551.
nathan
--
Dr Nathan Sidwell :: http://www.codesourcery.com :: CodeSourcery LLC
'But that's a lie.' - 'Yes it is. What's your point?'
nathan@codesourcery.com : http://www.cs.bris.ac.uk/~nathan/ : nathan@acm.org
// Build don't link:
// Copyright (C) 2000 Free Software Foundation, Inc.
// Contributed by Nathan Sidwell 11 Jan 2001 <nathan@codesourcery.com>
// Bug 1551. We were accessing some uninitialized memory, causing us
// to reject this.
template <typename T>
struct base
{
base();
base(unsigned);
};
template <typename V>
struct Y
{
Y(unsigned = 0);
};
template <>
Y<char>::Y(unsigned) { }
base<double> x;