Small fix for the C front end

Joseph S. Myers jsm28@cam.ac.uk
Wed Jan 23 10:33:00 GMT 2002


On Wed, 23 Jan 2002, Zack Weinberg wrote:

> require_complete_type will get a tree checking ICE if handed a value
> which is not itself error_mark_node, but has error_mark_node for its
> TREE_TYPE.  This patch fixes the bug.
> 
> I found this by "fuzz testing", so unfortunately I do not have a test
> case.  (However, with this patch, I was able to feed 100 megabytes of

You ought to ensure when doing fuzz testing that you keep or can reproduce
the fuzz that triggers an error.  (Though the testcase might still not be
small.)

> printable-ASCII line noise to cc1 without a single crash.)

What if you try line noise derived from valid code with random variation,
chunks mixed up / deleted / ..., ...?  There might be bugs shown up by
sort-of-C code derived from valid code that aren't shown up by completely
random ASCII.

> 	* c-typeck.c (require_complete_type): Return error_mark_node
> 	if type is error_mark_node.

OK.

-- 
Joseph S. Myers
jsm28@cam.ac.uk



More information about the Gcc-patches mailing list