Branch: refs/heads/master
Author: Alexander Eberspächer <alex.eberspaecher(a)gmail.com>
Committer: Alexander Eberspächer <alex.eberspaecher(a)gmail.com>
Date: Mon, 15 Jul 2013 08:06:37 UTC
Commit: e6878e5cbf47f1e7a000952380f1d6a3a7a63aa2
https://github.com/geany/geany/commit/e6878e5cbf47f1e7a000952380f1d6a3a7a63…
Log Message:
-----------
Fix ctags for complex Cython type declarations
Cython allows the use NumPy arrays on a C level. In that context, a
typical return type declaration could be e.g. "cpdef
numpy.ndarray[dtype=double, ndim=1] name". This now generates a tag for
the function. Previously, the equal sign prevented that.
Modified Paths:
--------------
tagmanager/ctags/python.c
Modified: tagmanager/ctags/python.c
8 files changed, 7 insertions(+), 1 deletions(-)
===================================================================
@@ -576,7 +576,13 @@ static const char *skipTypeDecl (const char *cp, boolean *is_class)
}
/* limit so that we don't pick off "int item=obj()" */
while (*ptr && loopCount++ < 2) {
- while (*ptr && *ptr != '=' && *ptr != '(' && !isspace(*ptr)) ptr++;
+ while (*ptr && *ptr != '=' && *ptr != '(' && !isspace(*ptr)) {
+ /* skip over e.g. 'cpdef numpy.ndarray[dtype=double, ndim=1]' */
+ if(*ptr == '[') {
+ while(*ptr && *ptr != ']') ptr++;
+ }
+ ptr++;
+ }
if (!*ptr || *ptr == '=') return NULL;
if (*ptr == '(') {
return lastStart; /* if we stopped on a '(' we are done */
--------------
This E-Mail was brought to you by github_commit_mail.py (Source: https://github.com/geany/infrastructure).
Branch: refs/heads/master
Author: Colomban Wendling <ban(a)herbesfolles.org>
Committer: Colomban Wendling <ban(a)herbesfolles.org>
Date: Sun, 14 Jul 2013 22:59:56 UTC
Commit: 66396e7ca7e892d734daf9b6579b3dce9a742548
https://github.com/geany/geany/commit/66396e7ca7e892d734daf9b6579b3dce9a742…
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:
--------------
tagmanager/ctags/php.c
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).
Branch: refs/heads/master
Author: Colomban Wendling <ban(a)herbesfolles.org>
Committer: Colomban Wendling <ban(a)herbesfolles.org>
Date: Sat, 13 Jul 2013 20:13:07 UTC
Commit: f23b7267cffcb615a4f970d824b38c04d58fc426
https://github.com/geany/geany/commit/f23b7267cffcb615a4f970d824b38c04d58fc…
Log Message:
-----------
Fix possible dereference of NULL pointer
Use g_set_error() instead of doing it manually and forgetting to check
whether the pointer is NULL or not before dereferencing it.
Spotted by clang --analyze.
Modified Paths:
--------------
src/utils.c
Modified: src/utils.c
27 files changed, 2 insertions(+), 25 deletions(-)
===================================================================
@@ -1657,23 +1657,6 @@ const gchar *utils_get_default_dir_utf8(void)
}
-static gboolean check_error(GError **error)
-{
- if (error != NULL && *error != NULL)
- {
- /* imitate the GLib warning */
- g_warning(
- "GError set over the top of a previous GError or uninitialized memory.\n"
- "This indicates a bug in someone's code. You must ensure an error is NULL "
- "before it's set.");
- /* after returning the code may segfault, but we don't care because we should
- * make sure *error is NULL */
- return FALSE;
- }
- return TRUE;
-}
-
-
/**
* Wraps g_spawn_sync() and internally calls this function on Unix-like
* systems. On Win32 platforms, it uses the Windows API.
@@ -1697,12 +1680,9 @@ gboolean utils_spawn_sync(const gchar *dir, gchar **argv, gchar **env, GSpawnFla
{
gboolean result;
- if (! check_error(error))
- return FALSE;
-
if (argv == NULL)
{
- *error = g_error_new(G_SPAWN_ERROR, G_SPAWN_ERROR_FAILED, "argv must not be NULL");
+ g_set_error(error, G_SPAWN_ERROR, G_SPAWN_ERROR_FAILED, "argv must not be NULL");
return FALSE;
}
@@ -1743,12 +1723,9 @@ gboolean utils_spawn_async(const gchar *dir, gchar **argv, gchar **env, GSpawnFl
{
gboolean result;
- if (! check_error(error))
- return FALSE;
-
if (argv == NULL)
{
- *error = g_error_new(G_SPAWN_ERROR, G_SPAWN_ERROR_FAILED, "argv must not be NULL");
+ g_set_error(error, G_SPAWN_ERROR, G_SPAWN_ERROR_FAILED, "argv must not be NULL");
return FALSE;
}
--------------
This E-Mail was brought to you by github_commit_mail.py (Source: https://github.com/geany/infrastructure).