[PATCH] PR c/70281: C FE: fix uninitialized range for __builtin_types_compatible_p

Jeff Law law@redhat.com
Fri Mar 18 17:04:00 GMT 2016


On 03/18/2016 10:25 AM, David Malcolm wrote:
> PR c/70281 reports another case where Valgrind identified an uninitialized
> src_range in a c_expr in the C frontend, this time in
> the parsing of __builtin_types_compatible_p.
>
> For gcc 7 I hope to fix this more robustly (via poisoning the values in
> a c_expr ctor), but for now, this patch fixes the specific issue found.
>
> Successfully bootstrapped on x86_64-pc-linux-gnu; adds 7 PASS results
> to gcc.sum.
>
> OK for trunk?
>
> gcc/c/ChangeLog:
> 	PR c/70281
> 	* c-parser.c (c_parser_postfix_expression): Set the source range
> 	for uses of "__builtin_types_compatible_p".
>
> gcc/testsuite/ChangeLog:
> 	PR c/70281
> 	* gcc.dg/plugin/diagnostic-test-expressions-1.c
> 	(test_builtin_types_compatible_p): New test function.
> 	* gcc.dg/pr70281.c: New test case.
OK
jeff



More information about the Gcc-patches mailing list