Skip to content

Commit fdb1a49

Browse files
PiotrZSLyuxuanchen1997
authored andcommitted
[clang-tidy][NFC] Fix tiny bug in areStatementsIdentical
Summary: Function areStatementsIdentical had an early exit when classes of stmt does not match. That if were added to speed up checking and do not calculate hash id of both objects if they are not the same type. Due to some bug, wrong pointer were used and this resulted with comparing self to self. This patch fixes this issue. Test Plan: Reviewers: Subscribers: Tasks: Tags: Differential Revision: https://phabricator.intern.facebook.com/D60251054
1 parent ae59d23 commit fdb1a49

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

clang-tools-extra/clang-tidy/utils/ASTUtils.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -96,7 +96,7 @@ bool areStatementsIdentical(const Stmt *FirstStmt, const Stmt *SecondStmt,
9696
if (FirstStmt == SecondStmt)
9797
return true;
9898

99-
if (FirstStmt->getStmtClass() != FirstStmt->getStmtClass())
99+
if (FirstStmt->getStmtClass() != SecondStmt->getStmtClass())
100100
return false;
101101

102102
if (isa<Expr>(FirstStmt) && isa<Expr>(SecondStmt)) {

0 commit comments

Comments
 (0)