-
Notifications
You must be signed in to change notification settings - Fork 1.8k
C++: add Declaration.hasGlobalOrStdName() #1585
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
C++: add Declaration.hasGlobalOrStdName() #1585
Conversation
Changes LGTM. Do you have any idea whether this is likely to create significant new results for any queries / projects? |
54e2330
to
77db30b
Compare
Rebased over the autoformat patches and moved changenote to 1.23 |
@@ -58,7 +58,7 @@ predicate overflowOffsetInLoop(BufferAccess bufaccess, string msg) { | |||
} | |||
|
|||
predicate bufferAndSizeFunction(Function f, int buf, int size) { | |||
f.hasGlobalOrStdName("read") and buf = 1 and size = 2 | |||
f.hasStdName("read") and buf = 1 and size = 2 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What does the hasStdName()
predicate do exactly? I ask because I don't believe that read
(and other unbuffered I/O routines) get pulled into namespace std
.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I did that backwards - fixed after the rebase
e5cbf3c
to
4018ed6
Compare
I've resolved all my comments that you've addressed. Two are left. |
6a19497
to
5c084f8
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
[ERROR] Input file ql/cpp/ql/src/Critical/OverflowCalculated.ql is not correctly formatted
Otherwise LGTM.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
This predicate was removed before github#1585 was merged, but we forgot to remove it from the change note.
This adds
Declaration.hasGlobalOrStdName
andDeclaration.hasStdName
, and converts uses ofhasGlobalName
that refer to C standard library functions that are in thestd
namespace in C++ to usehasGlobalOrStdName
instead.