This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: [RFA:] Fix two uninitialized-bugs in cppexp.c spotted byvalgrind
- From: Zack Weinberg <zack at codesourcery dot com>
- To: Hans-Peter Nilsson <hp at bitrange dot com>
- Cc: gcc-patches at gcc dot gnu dot org
- Date: Fri, 29 Nov 2002 09:48:39 -0800
- Subject: Re: [RFA:] Fix two uninitialized-bugs in cppexp.c spotted byvalgrind
- References: <Pine.BSF.4.44.0211290753100.39634-100000@dair.pair.com>
Hans-Peter Nilsson <hp@bitrange.com> writes:
> * cppexp.c (num_part_mul): Initialize result.unsignedp, to 1.
> (eval_token): Initialize temp.
...
> default: /* CPP_HASH */
> + /* For recovery, an erroneous assertion expression is handled as a
> + failing assertion. */
> + temp = 0;
> _cpp_test_assertion (pfile, &temp);
Please address this by making _cpp_test_assertion always store a value
into its second argument, instead. A patch to do that is pre-approved.
> result.high += HIGH_PART (middle[0]);
> result.high += HIGH_PART (middle[1]);
> + result.unsignedp = 1;
This piece is fine.
zw