Skip to content

C++: Support C11 _Generic expressions#17138

Merged
jketema merged 3 commits into
github:mainfrom
jketema:generic
Sep 3, 2024
Merged

C++: Support C11 _Generic expressions#17138
jketema merged 3 commits into
github:mainfrom
jketema:generic

Conversation

@jketema
Copy link
Copy Markdown
Contributor

@jketema jketema commented Aug 2, 2024

No description provided.

@github-actions github-actions Bot added the C++ label Aug 2, 2024
@jketema jketema added the depends on internal PR This PR should only be merged in sync with an internal Semmle PR label Aug 2, 2024
Comment thread cpp/ql/test/library-tests/ir/ir/raw_ir.expected Outdated
@jketema jketema force-pushed the generic branch 4 times, most recently from f56660a to eefc3cf Compare August 29, 2024 15:33
@jketema jketema marked this pull request as ready for review August 30, 2024 13:45
@jketema jketema requested a review from a team as a code owner August 30, 2024 13:45
# 14| m14_2(int) = Uninitialized[i] : &:r14_1
# 16| r16_1(glval<char *>) = VariableAddress[#return] :
# 16| r16_2(glval<char[4]>) = StringConstant[int] :
# 16| r16_2(glval<char[4]>) = Constant[int] :
Copy link
Copy Markdown
Contributor Author

@jketema jketema Aug 30, 2024

Choose a reason for hiding this comment

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

This is due to the the getType on the Value associated with the Generic being of ArrayType (only the underlying type is). This is inconsequential though.

Similar for the almost identical change below.

@jketema jketema requested a review from geoffw0 September 3, 2024 07:57
geoffw0
geoffw0 previously approved these changes Sep 3, 2024
Copy link
Copy Markdown
Contributor

@geoffw0 geoffw0 left a comment

Choose a reason for hiding this comment

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

QL, tests and upgrade/downgrade scripts LGTM.

I trust the upgrade/downgrade scripts have been tested, and that the CI and DCA run looks good on the other PR?

It might be nice to have a test demonstrating data flow through generic expressions, but I won't hold this up for it.

Comment thread cpp/ql/test/library-tests/ir/ir/PrintAST.expected
Comment thread cpp/ql/lib/semmle/code/cpp/exprs/Expr.qll Outdated
@jketema
Copy link
Copy Markdown
Contributor Author

jketema commented Sep 3, 2024

I trust the upgrade/downgrade scripts have been tested, and that the CI and DCA run looks good on the other PR?

Correct.

It might be nice to have a test demonstrating data flow through generic expressions, but I won't hold this up for it.

The IR tests effectively demonstrate that the IR before and after are identical, so I don't think this adds much.

@jketema jketema merged commit 62766f6 into github:main Sep 3, 2024
@jketema jketema deleted the generic branch September 3, 2024 15:26
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

C++ depends on internal PR This PR should only be merged in sync with an internal Semmle PR documentation

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants