-
Notifications
You must be signed in to change notification settings - Fork 2
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
Replace libdparse in IfElseSameCheck #81
Replace libdparse in IfElseSameCheck #81
Conversation
src/dscanner/analysis/ifelsesame.d
Outdated
"dscanner.bugs.if_else_same", "'Else' branch is identical to 'Then' branch."); | ||
ifStatement.accept(this); | ||
} | ||
if (s.elsebody && to!string(s.ifbody.toChars()) == to!string(s.elsebody.toChars())) |
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 think that using strcmp
is better than going through the hurdles of using to
.
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.
Is strcmp behaviour identical to C? If so, wouldn't that leave the program vulnerable? Wouldn't it be better to use D's strings instead of char * ?
820a5a8
to
2bf728f
Compare
ddd30f7
to
e681e59
Compare
826af62
to
10c6de3
Compare
10c6de3
to
11e1dbf
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.
Is this PR ready for review? I'm seeing a lot of commented code.
Kind of. I've followed your comments, the Visitor Doc Comment and I've added a few more checks. Now, this visitor should check: logical expressions, assignments, comparisons, However, d-scanner with those new checks fails when applied to Phobos. There are unit tests in phobos that explictly check comparisons, so expressions like |
This is failing phobos. IIRC, we discussed that you will preserve the behavior of dscanner and not add any new behavior. |
Yep, will revert to old state |
#73 cont