Skip to content

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

Merged
merged 9 commits into from
Nov 12, 2019

Conversation

rdmarsh2
Copy link
Contributor

This adds Declaration.hasGlobalOrStdName and Declaration.hasStdName, and converts uses of hasGlobalName that refer to C standard library functions that are in the std namespace in C++ to use hasGlobalOrStdName instead.

@rdmarsh2 rdmarsh2 added the C++ label Jul 12, 2019
@rdmarsh2 rdmarsh2 requested a review from a team as a code owner July 12, 2019 17:37
@geoffw0
Copy link
Contributor

geoffw0 commented Jul 12, 2019

Changes LGTM.

Do you have any idea whether this is likely to create significant new results for any queries / projects?

@rdmarsh2 rdmarsh2 force-pushed the rdmarsh/cpp/hasGlobalOrStdName branch from 54e2330 to 77db30b Compare September 13, 2019 20:04
@rdmarsh2
Copy link
Contributor Author

Rebased over the autoformat patches and moved changenote to 1.23

hubwriter
hubwriter previously approved these changes Sep 16, 2019
semmledocs-ac
semmledocs-ac previously approved these changes Sep 16, 2019
@@ -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
Copy link
Contributor

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.

Copy link
Contributor Author

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

@rdmarsh2 rdmarsh2 force-pushed the rdmarsh/cpp/hasGlobalOrStdName branch from e5cbf3c to 4018ed6 Compare October 2, 2019 18:42
@jbj
Copy link
Contributor

jbj commented Oct 3, 2019

I've resolved all my comments that you've addressed. Two are left.

@rdmarsh2 rdmarsh2 force-pushed the rdmarsh/cpp/hasGlobalOrStdName branch from 6a19497 to 5c084f8 Compare October 7, 2019 21:18
Copy link
Contributor

@jbj jbj left a 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.

@dbartol dbartol self-assigned this Nov 12, 2019
Copy link

@dbartol dbartol left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@dbartol dbartol merged commit 5b33255 into github:master Nov 12, 2019
jbj added a commit to jbj/ql that referenced this pull request Nov 20, 2019
This predicate was removed before github#1585 was merged, but we forgot to
remove it from the change note.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

7 participants