[PATCH] Fix PR objc/68438 (uninitialized source ranges)

David Malcolm dmalcolm@redhat.com
Fri Nov 20 20:28:00 GMT 2015


The attached patch fixes some more places in c/c-parser.c where the
src_range field of a c_expr was being left uninitialized, this time for
various Objective C constructs.

The source ranges are verified using the same unit-testing plugin used
for C expressions.  This leads to a wart, which is that it means having
a .m test file lurking below gcc.dg/plugin.  A workaround would be to
create an objc.dg/plugin subdirectory, with a new plugin.exp for testing
Objective C plugins, and having it reference the existing plugin below
gcc.dg/plugin.  That seemed like excessive complication, so I went for
the simpler approach of simply putting the .m file below gcc.dg/plugin.

I manually verified that this fixes the specific valgrind warnings
reported in the PR, and visually inspected the code for
objective-c-specific instances of uninitialized c_expr src_range values.

Bootstrapped&regrtested on x86_64-pc-linux-gnu; adds 15 PASS results to
gcc.sum.

OK for trunk?

-------------- next part --------------
A non-text attachment was scrubbed...
Name: fix-PR-objc-68438-uninitialized-source-ranges.patch
Type: text/x-patch
Size: 7496 bytes
Desc: not available
URL: <http://gcc.gnu.org/pipermail/gcc-patches/attachments/20151120/1849e98d/attachment.bin>


More information about the Gcc-patches mailing list