Branch: refs/heads/master
Author: Colomban Wendling <ban(a)herbesfolles.org>
Committer: Colomban Wendling <ban(a)herbesfolles.org>
Date: Thu, 23 Jan 2014 13:17:43 UTC
Commit: d40932ce4d05e57573a6d6c8f89f4aea8c42d4f3
https://github.com/geany/geany/commit/d40932ce4d05e57573a6d6c8f89f4aea8c42d…
Log Message:
-----------
C++: mitigate matching error on generics containing an expression
Mitigate parse error with generics like `foo<X<Y> x;` by avoiding
matching past a semicolon (";") or open curly brace ("{"), which
can't be part of the generic. This isn't a proper fix, but mitigates
the impact of such constructs.
Modified Paths:
--------------
tagmanager/ctags/c.c
tests/ctags/bug1563476.cpp.tags
Modified: tagmanager/ctags/c.c
10 files changed, 10 insertions(+), 0 deletions(-)
===================================================================
@@ -1650,6 +1650,16 @@ static void skipToMatch (const char *const pair)
break;
}
}
+ /* early out if matching "<>" and we encounter a ";" or "{" to mitigate
+ * match problems with C++ generics containing a static expression like
+ * foo<X<Y> bar;
+ * normally neither ";" nor "{" could appear inside "<>" anyway. */
+ else if (isLanguage (Lang_cpp) && begin == '<' &&
+ (c == ';' || c == '{'))
+ {
+ cppUngetc (c);
+ break;
+ }
}
if (c == EOF)
{
Modified: tests/ctags/bug1563476.cpp.tags
2 files changed, 2 insertions(+), 0 deletions(-)
===================================================================
@@ -1,3 +1,5 @@
# format=tagmanager
+IntroduceBitDefÌ2048Ö0
IntroduceBitDefÌ32768Ö0
+fÌ16Í()ÎIntroduceBitDefÖ0Ïint
gÌ16Í()Ö0Ïint
--------------
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: Wed, 22 Jan 2014 16:38:29 UTC
Commit: c2dcec7107514c0632d8f657c3325b3963cf22a6
https://github.com/geany/geany/commit/c2dcec7107514c0632d8f657c3325b3963cf2…
Log Message:
-----------
Don't use G_LIKELY() in macros commonly used in g_return_if_fail()
g_return_if_fail() puts itself its condition in a G_LIKELY() clause,
and nested G_LIKELY() lead to warnings about shadowed variables, as
well as not being of any use.
Also, hiding G_LIKELY() in a macro may lead to unexpected use of it
which may hint the compiler incorrectly.
Modified Paths:
--------------
src/document.h
Modified: src/document.h
2 files changed, 1 insertions(+), 1 deletions(-)
===================================================================
@@ -146,7 +146,7 @@ struct GeanyDocument
* @note This should not be used to check the result of the main API functions,
* these only need a NULL-pointer check - @c document_get_current() != @c NULL. */
#define DOC_VALID(doc_ptr) \
- (G_LIKELY((doc_ptr) != NULL && (doc_ptr)->is_valid))
+ ((doc_ptr) != NULL && (doc_ptr)->is_valid)
/**
* Returns the filename of the document passed or @c GEANY_STRING_UNTITLED
--------------
This E-Mail was brought to you by github_commit_mail.py (Source: https://github.com/geany/infrastructure).