diff options
author | Richard Henderson <rth@cygnus.com> | 1998-09-08 02:06:28 -0700 |
---|---|---|
committer | Mark Mitchell <mmitchel@gcc.gnu.org> | 1998-09-08 09:06:28 +0000 |
commit | 76a837824acebe0c785ebeb0a43e39e4be528975 (patch) | |
tree | 0cdc9c0bfab1f094b54611687d57f53de273232b | |
parent | f2bd33a3e6e1ba2d09bd30826cbf64a0ee70cc5a (diff) | |
download | gcc-76a837824acebe0c785ebeb0a43e39e4be528975.zip gcc-76a837824acebe0c785ebeb0a43e39e4be528975.tar.gz gcc-76a837824acebe0c785ebeb0a43e39e4be528975.tar.bz2 |
pt.c (process_partial_specialization): Consistantly allocate and zero tpd.parms based on ntparms.
* pt.c (process_partial_specialization): Consistantly allocate
and zero tpd.parms based on ntparms. Use tpd2.parms, not
tpd.parms, where appropriate.
Co-Authored-By: Mark Mitchell <mark@markmitchell.com>
From-SVN: r22325
-rw-r--r-- | gcc/cp/ChangeLog | 7 | ||||
-rw-r--r-- | gcc/cp/pt.c | 7 |
2 files changed, 12 insertions, 2 deletions
diff --git a/gcc/cp/ChangeLog b/gcc/cp/ChangeLog index 7315d25..4382a2a 100644 --- a/gcc/cp/ChangeLog +++ b/gcc/cp/ChangeLog @@ -1,3 +1,10 @@ +1998-09-08 Richard Henderson <rth@cygnus.com> + Mark Mitchell <mark@markmitchell.com> + + * pt.c (process_partial_specialization): Consistantly allocate + and zero tpd.parms based on ntparms. Use tpd2.parms, not + tpd.parms, where appropriate. + Sun Sep 6 00:00:51 1998 Jeffrey A Law (law@cygnus.com) * Makefile.in (INCLUDES): Update after recent toplevel gcc diff --git a/gcc/cp/pt.c b/gcc/cp/pt.c index 04c9fd6..e95d7d1 100644 --- a/gcc/cp/pt.c +++ b/gcc/cp/pt.c @@ -1912,7 +1912,7 @@ process_partial_specialization (decl) or some such would have been OK. */ tpd.level = TMPL_PARMS_DEPTH (current_template_parms); tpd.parms = alloca (sizeof (int) * ntparms); - bzero (tpd.parms, sizeof (int) * nargs); + bzero (tpd.parms, sizeof (int) * ntparms); tpd.arg_uses_template_parms = alloca (sizeof (int) * nargs); bzero (tpd.arg_uses_template_parms, sizeof (int) * nargs); @@ -1985,6 +1985,9 @@ process_partial_specialization (decl) /* We haven't yet initialized TPD2. Do so now. */ tpd2.arg_uses_template_parms = (int*) alloca (sizeof (int) * nargs); + /* The number of paramters here is the number in the + main template, which, as checked in the assertion + above, is NARGS. */ tpd2.parms = (int*) alloca (sizeof (int) * nargs); tpd2.level = TMPL_PARMS_DEPTH (DECL_TEMPLATE_PARMS (maintmpl)); @@ -1995,7 +1998,7 @@ process_partial_specialization (decl) template, not in the specialization. */ tpd2.current_arg = i; tpd2.arg_uses_template_parms[i] = 0; - bzero (tpd.parms, sizeof (int) * nargs); + bzero (tpd2.parms, sizeof (int) * nargs); for_each_template_parm (type, &mark_template_parm, &tpd2); |