Skip to content

Commit d48d480

Browse files
committed
[clang-tidy][NFC] Fix tiny bug in areStatementsIdentical
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.
1 parent b846176 commit d48d480

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)