linux-sparse.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [RFC] infinite loop in free_preprocessor_line()
@ 2007-05-26  0:24 Alexey Dobriyan
  2007-05-27  0:35 ` Josh Triplett
  0 siblings, 1 reply; 4+ messages in thread
From: Alexey Dobriyan @ 2007-05-26  0:24 UTC (permalink / raw)
  To: linux-sparse

While running if-2.c from gcc testsuite sparse goes into infinite loop in
free_preprocessor_line().

Trimmed down test-case is

	#if 1
	#if

(two lines)

--- a/pre-process.c
+++ b/pre-process.c
@@ -763,11 +763,11 @@ out:
 
 static int free_preprocessor_line(struct token *token)
 {
-	do {
+	while (token_type(token) != TOKEN_EOF) {
 		struct token *free = token;
 		token = token->next;
 		__free_token(free);
-	} while (token_type(token) != TOKEN_EOF);
+	};
 	return 1;
 }
 

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2007-06-03 22:27 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2007-05-26  0:24 [RFC] infinite loop in free_preprocessor_line() Alexey Dobriyan
2007-05-27  0:35 ` Josh Triplett
2007-06-02 21:55   ` Alexey Dobriyan
2007-06-03 22:27     ` Josh Triplett

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).