Skip to content

CPP: More tests of isSideEffectFree() / ExprHasNoEffect.ql#641

Merged
rdmarsh2 merged 2 commits into
github:masterfrom
geoffw0:exprnoeffect2
Dec 11, 2018
Merged

CPP: More tests of isSideEffectFree() / ExprHasNoEffect.ql#641
rdmarsh2 merged 2 commits into
github:masterfrom
geoffw0:exprnoeffect2

Conversation

@geoffw0

@geoffw0 geoffw0 commented Dec 7, 2018

Copy link
Copy Markdown
Contributor

The first part of this is a test case from https://git.semmle.com/Semmle/code/pull/19744/commits/c7f56d2588bf00060e2969050a493e3c8f4b144c (never merged) about how isSideEffectFree() handles the presence of an ErrorExpr. The test now produces the results I'd expect (in particular the third case, which like the second contains an ErrorExpr so cannot be assumed to be side-effect free).

The second part of this PR is a simple test case for 'Expression has no effect' on CommaExpr, a subject that's been discussed lately. In fact we already had some test cases but the new ones are clearer.

@rdmarsh2

@geoffw0 geoffw0 added the C++ label Dec 7, 2018
@geoffw0 geoffw0 requested a review from a team as a code owner December 7, 2018 14:39

@rdmarsh2 rdmarsh2 left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Tests look good to me

@rdmarsh2 rdmarsh2 merged commit 98005ed into github:master Dec 11, 2018
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.

2 participants