From: Neil Booth Date: Thu, 9 May 2002 22:27:31 +0000 (+0000) Subject: * cppexp.c (_cpp_expand_op_stack): Set op_limit. X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=32fa4565a7d89525a0577f2bffed598f1d1d9194;p=gcc.git * cppexp.c (_cpp_expand_op_stack): Set op_limit. From-SVN: r53348 --- diff --git a/gcc/ChangeLog b/gcc/ChangeLog index f6978fb0d1a..1dd90ee30c8 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,7 @@ +2002-05-09 Neil Booth + + * cppexp.c (_cpp_expand_op_stack): Set op_limit. + 2002-05-09 Rainer Orth * config/mips/t-iris6 (SHLIB_SLIBDIR_SUFFIXES): Define. diff --git a/gcc/cppexp.c b/gcc/cppexp.c index 288cdd406b0..84fcac5e8f1 100644 --- a/gcc/cppexp.c +++ b/gcc/cppexp.c @@ -824,10 +824,12 @@ struct op * _cpp_expand_op_stack (pfile) cpp_reader *pfile; { - size_t n = (size_t) (pfile->op_limit - pfile->op_stack); + size_t old_size = (size_t) (pfile->op_limit - pfile->op_stack); + size_t new_size = old_size * 2 + 20; pfile->op_stack = (struct op *) xrealloc (pfile->op_stack, - (n * 2 + 20) * sizeof (struct op)); + new_size * sizeof (struct op)); + pfile->op_limit = pfile->op_stack + new_size; - return pfile->op_stack + n; + return pfile->op_stack + old_size; }