[geany/geany] 66396e: PHP: Fix infinite loop reading an identifier ending at EOF

Colomban Wendling git-noreply at xxxxx
Sun Jul 14 22:59:56 UTC 2013

Branch:      refs/heads/master
Author:      Colomban Wendling <ban at herbesfolles.org>
Committer:   Colomban Wendling <ban at herbesfolles.org>
Date:        Sun, 14 Jul 2013 22:59:56 UTC
Commit:      66396e7ca7e892d734daf9b6579b3dce9a742548

Log Message:
PHP: Fix infinite loop reading an identifier ending at EOF

Bit-wise operation is inappropriate here because `c` might be negative,
since EOF is generally represented as -1.  Since -1 is stored as all
bits at 1 on most common architectures, the test will evaluate to true,
hence entering an infinite loop.

Modified Paths:

Modified: tagmanager/ctags/php.c
2 files changed, 1 insertions(+), 1 deletions(-)
@@ -498,7 +498,7 @@ static void addToScope (tokenInfo *const token, const vString *const extra)
 static boolean isIdentChar (const int c)
-	return (isalnum (c) || c == '_' || c & 0x80);
+	return (isalnum (c) || c == '_' || c >= 0x80);
 static int skipToCharacter (const int c)

This E-Mail was brought to you by github_commit_mail.py (Source: https://github.com/geany/infrastructure).

More information about the Commits mailing list