[RFC] infinite loop in free_preprocessor_line()

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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;
 }
 

-
To unsubscribe from this list: send the line "unsubscribe linux-sparse" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html

[Index of Archives]     [Newbies FAQ]     [LKML]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]     [Trinity Fuzzer Tool]

  Powered by Linux